« first day    last day (4149 days later) » 

6:26 AM
ahaa! I'm back!
 
7:20 AM
Morning guys
 
Mornin'
I'm having a look at the MeasureOverride and ArrangeOverride
 
that's a very good thing :)
i though about your panel
and scrolling problem
 
breakfast... brb
 
the way I would handle it would be to Subclass StackPanel
and override Measure override
bon appetit :)
 
morning guys
:)
 
7:36 AM
Hey Samy :)
 
don't have much to do today....
i'm bored :(
 
^^
i have so much to do
I'm not bored :D
 
there, sorry I had to go...
 
np mate
 
ok, so I thought about overriding the ListView... but you say the stackpanel...
 
7:51 AM
yeap
you issue is not with managind the objects
(responsibility of the ListView)
but with layouting WPF controls
(responsability of the panel)
 
But the ListView's are not located in the stackpanel anymore...
 
they are in a panel right ?
 
dock
ehh grid -> scroll -> dock -> {Stackpanel -> objects ; Grid -> ListViews }
if you understand
 
yeap
that sure is complicated :D
 
hehe
 
7:55 AM
what I would do
if I had time
Scroll -> CustomPanel -> objects, listViews
 
mhmm I was hoping to avoid that...
I'm looking at the first answer in here (social.msdn.microsoft.com/Forums/en-US/wpf/thread/…)
and it seem to be a rather good description... just that I can't penetrate it enought
the "passing in how much space you are willing to give them and getting back how much space they would like to have." confuses me...
 
lemme see
it's simple
 
ok now I get it... I think
:)
 
MeasureOverride take a size as parameter
and returns another size
the size it take in parameter is the available space
if your control is inside a grid that's 50x50
 
ehh I should run Measure on all the children and in that call tell them how much they can have?
 
8:02 AM
it will be 50x50 available
not exactly
you run measure on echa child
and each chil will tell you how much space they WANT
doesnt mean you have to give them all
base on that
you can say what space you want
if you have 3 children, each want 10 height
and you want to impelmetn a stack logic
you can say you want 30 height
once again that does not mean you WILL give 30 height to the control
it just means : hey that's what I need to render
 
and what should I do with the constraint?
 
The ArrangeOverride will have to decide how much space
it will give the children
what constraint ?
 
the input to the measureOverride
 
generally you pass it to the children
and you don't do much more
but it's as you wan
You can do anything you want with it
in your case
this size will be infinite
because you will be embedded in a scrollViewer
and the MeasureOverride of a scrollViewer always give infinite space to its children (which is logicial, it's all the point of having a scrollviewer :D )
 
yes, ok. so let me think for a bit...
 
8:11 AM
^^
it's actaully not that complicated to achieve what you need
you want a stackpanel
with every items in it that will take all the space they need
except for scrollable inner items
that will share the remaining space right ?
 
mm more or less
 
more or less ?
:)
 
well if there is no remaining space...
then I wan't them to have there minWidth instead of the remaining
 
ok
just in case there is 0 space remaning ?
 
mm
 
8:16 AM
or you want to alway have their minWidth ?
 
or less than minHeight
 
minHeight sorry
 
nono not always, they should grow if they have the chanse :)
let's say the minHeight (for both of them together) is 100, and the availible size is 50, then I want them to have minHeight, but if the availible size is 150 then I want them to take 150
so in this layout that I have now, the problem is that the ArrangeOverride in the children always will get inf?
BTW what's the difference between measure and measureOverride?
 
well
measureoverride is the overrideable entry point
measure is the core method you call in the measureOverride
 
but when I call measure on a object, does that then run it's measureOverride?
 
8:28 AM
yes
 
ok
 
measure will call MeasureCore which will call MeasureOverride
 
and really nothing happens in the measure or measureCore then?
 
not really
it's juste pipes
basic mechanism
layout logic is in MeasureOverride
 
mhmm, How do you know all this?
 
8:37 AM
I read a lot of WPF books ^^
and
i ofent debug in .NET assemblies
you can see all the layout algorithm
 
ok. impressive knowledge base
 
lol
:)
it's really basic WPF layouting knowledge ^^
making a custom panel might be the first thing i tried when first playing with WPF ^^
 
ok. So I recon your not from unitedStatesOfTheAmerica since your up so early?
 
I'm from Paris ;)
 
nice.
 
8:45 AM
and you ?
 
Le Göteborg
(sweden)
 
Sweden ! Sweet !
 
... it has some pros and cons, one of the worst thing is the weather... this summer we had 5 days > 25degC
"summer"....
 
:D
 
hmm so If I make the windows smaller than the LB needs (that is to show all it's childs) then the ArrangeOverride doesn't get called...
 
9:15 AM
hu ?
 
 
1 hour later…
10:34 AM
mm well just noticed that if the window got smaller than the ListView's (not LB, sorry) MeasureOverride, then ArrangeOverride doesn't get called anymore
(until the window get larger again
)
 
that's strange
 
10:59 AM
The measureOverride is only run in the beginning of the program (or possibly at update of the listview)?
 
11:09 AM
it's supposed to be called everythime the UI needs to be refreshed
 
hmm ok I see that if I just place a ListView in the window then it is called when I resize the window, but when it lies in my other structure it doesn't get called
 
11:36 AM
nee this god damn resizing thing!!!! now I give up.
 
11:56 AM
lol
I can see if I can do something about it this week end
 
I'm thinking that it should be possible to solve with just a extension of some class, either the ListView, DockPanel or something. If you find something fast and easy, it would be super. But don't waste to much time with it!
 
sure
 
12:15 PM
worst thing is that if I don't care about the fact that the listViews gets to large. the mouse scroll doesn't get passed on to the scrollview... :(
 
event must be handled by the listView
 
and send the event to the scrollview?
 
 
1 hour later…
1:21 PM
Morning / Afternoon / Evening room :)
@Sisyphe PING!
 
Plingelling
 
:)
well at least there's life in here now :)
how is your layout thing going?
 
1:41 PM
ok, so I have dropped the sizing issue for the moment, and now I have a bigger question... when making a control. Is it a good way to try to follow the MVVM pattern?
hold on, ill try to describe it better...
 
personally, being a perfectionist, I'd always strive to follow patterns & practices but I'm not as experienced with custom controls. @Sisyphe may be better person to answer this
 
mm.. I have an image in my mind that it's good to make a general design. That is; let's say the control that I'm making is used to present some data. Let's say the control contains a listview, a textbox and also a button. So I can add data to my control and it should show my data in the listbox, and when I select one if the listitems the textbox shall show some text and... Now the thing is... (wait for it)
I want to be able to add different types of data to my control, they have to implement an interface so I know that certain functions exist, but other than that it can be any kind of data.
so the control will ask the object (hence the interface functions) how it wants to be presented (a little like the toString() function). But here I want the objects to supply more than just a string, I want them to supply some kind of graphics.
So what is the real question?? Is it a bad idea to have the object (which in some way comes from the model), have information about how to show itself?
 
2:02 PM
Hey Maverik :D
sorry was out getting some lunch ^^
the object can have some data that can be used by the ViewModel to tell the view how to display them
Have an interface in you models assembly taht will contain all the properties you'll need
have a viewModel per type of display data
make some data template based on these viewModels
 
Hey Sisyphe, and that ^
 
what's up mate ?
 
nothing much - I overslept today - half a day to be exact and just came to office an hour back
I still feel sleepy!
 
lol
I'm quite exhausted too
wekk end will save me
 
the object is only a standard .cs, can I add a wpf (for instance a template to this class). At the moment I'm trying to create a template with a FrameworkElementFactory. But that's quite much more work than a simple wpf template?
 
2:14 PM
when you say standard .cs you mean a custom control ?
you simply subclassed an existing WPF control right ?
 
nae. the object comes as a standard .cs
 
what object ? :)
 
hehe that's the object that I add to my custcontr
 
i'm really not following what you are saying mate :D
 
hehe so I have a control, to which I can add any kind of objects (as long as they implement a special interface)
and I (the control) ask the object how it wants to be presented
the reason for this is so I don't have to redesign my control every time I wan't to add a new type of object
get the picture?
 
2:22 PM
Sounds almost like you're trying to implement DataTemplateSelector functionality
 
yeap
 
mm but then the templates would have to be placed in the control?
 
@Markus no - thats what DataTemplateSelector class is for - the class has the logic in it (that you provide) to figure how to present the control (which you'd know since you're providing the logic how to get to the right data template outside the control)
 
hmm ok, ill have a second look at it. thanks
 
that should give you an idea
for more information just google DataTemplateSelector
 
 
1 hour later…
3:36 PM
@Sisyphe here?
 
yup
Thanks, but do you have a source link? I just would like to be sure that there is no other converter hanging around without being caught =) — Damascus 14 mins ago
interresting question here ^^
 
4:18 PM
I'm about to create a view to present this sort of detail:
    Organisation
	Users
		Mailbox
			Organisations -^
			User -^
		Application Subscriptions
			Organisations -^
			Users -^
		Mobility Details
			Organisations -^
			Users -^
		VoIP Details
			Organisations -^
			Users -^
	Public Folders
	Application Subscriptions
		Organisations -^
		Users -^
where -^ represents recursive view of parent
is this making any sense?
The idea is, you can start from any root and explore from there to whatever information you're looking for
so while I'm starting from Orgs, you may very well start from Application Subscriptions and see all Organisations that are subscribed to that subscription and then dive into the users that are subscribed to it under that org
I'm trying to figure how to best display this sort of information
at the moment its a ListView in a TabControl and depending on which cell is click in that ListView a new Tab opens with the relevant information
while that works for most of the information, it does limit you in the sort of queries you can run on given data - I'm trying to work around it by enabling the user to specify the starting node and then drill in from there
 
4:34 PM
@Sisyphe really nice answer there. I always wondered the same thing but was never fussed enough to dig through the framework
 
Sorry
back
 
wb
feel free to read the wall of text above
 
5:00 PM
@Sisyphe busy eh? any thoughts?
 
5:29 PM
right headed home now - have a nice weekend and catch you monday!
 
6:01 PM
Sorry dude, very complicated end of week
your problem seems interresting
 

« first day    last day (4149 days later) »