« first day (7 days earlier)      last day (4142 days later) » 

7:52 AM
Morning
 
 
1 hour later…
9:07 AM
Good morning :)
 
Hey mate
 
9:23 AM
Sisyphe, do you have any idea how to cope with NaN height values?
and width values for that matter
 
what do you mean, cope with ? :)
they are actually quite handy
if you need the real size of a rendered element that Height is NaN, you can always check RenderSize.Height or RenderSize.Width
and AcutalHeigh
ActualHeight
ActualWidth
those are readOnly calculated Dependency Properties
 
The thing is that I've basically tried all these things and never managed to get the actual value
I had asked a question a while ago and so far haven't managed to solve it
0
Q: Unable to get window width

Dot NETI've got a WPF window, and I'm trying to get the Width property. No matter where I try to present the code, it always returns as NaN. I have looked up on the internet and read that I should actually be using ActualWidth instead, but this returns 0 no matter what. How can I get rid of the lag an...

 
that's probably because the element has not been rendered yet
let me check it ;)
well you flagged an answer ?
 
Out of gratitude :) Someone spent around 2 hours trying to help me in a chatroom
 
ok ^^
 
9:36 AM
I basically put this problem on hold and moved on, but now i really need to solve it
Was just wondering if you have any idea. No need to go into it in detail as it's not worth the hassle. This library probably just makes it impossible
 
hmmm
nothing is impossible
I'll need to test it out
but retrieving an height is always possible
at one point, the rendering engine HAVE to calculates it to display it
 
The main problem is that my window is contained in an MdiChild
 
wel that's not an issue
once again
when you render it
 
So while the window is sized to fit its content, the MdiChild should also size to fit the window
 
the engine WILL compute the size
there are plenty of entry points
just have to find the right one
i'll give it some attention as soon as I can
 
9:47 AM
That would be great thanks :)
 
would you have a minimal project that shows the issue ?
that would help a lot ;)
 
I think it's pretty easy to recreate
I could do that if you like
Should I just create a WPF project and send that?
 
well if you could wrap it into a solution that would help yeah :D
sure !
 
Ok sure, I could create a solution
ill get started on it :)
 
great
 
10:02 AM
done!
 
nice
send it to sami.touil@sap.com
 
sent :)
It's a simple project which displays an MdiChild on the screen, containing the DatabaseTable usercontrol
the latter's width and size enclose the contents, but the mdichild does not
so quite simple :)
Hmm email wasnt sent apparently
got a postmaster notification
Do you have another email address i could try?
 
10:19 AM
yeap
sami.touil@gmail.com
 
Sent :)
Hmm didnt let me send either
I'm guessing it's cos of the executables
I'll upload it to dropbox and send you a link instead
Ok?
 
Moarninggg
Oomagawd!!
 
Good morning :)
 
an email address!! must sell!
hey dot :)
 
There's the link for when Sisyphe is back: dropbox.com/s/nj6e02md96lmv06/TestApplication.zip
 
10:31 AM
hijacking link
btw - weren't we working with NaN stuff last time you were here?
feels ignored
 
Hey sorry, alt+tabbing with my project xD You're right, we were working with NaN, but in a different context
Thankfully it wasn't the cause of a problem that time :p
 
Hey Maverik
 
hey
 
I'm going to get killed
 
i thought you're ignoring me cos I sold your email on blackmarket :)
 
10:36 AM
beta will not be out today
ho well that kind of things happens
 
you tried your best mate - such is nature of software
thats why i prefer nightlies over beta cycles
ok so what height are we talking about?
(I have your project)
 
i'm lading it too
let's make a contest :D
 
well i'm sure you'll win.. i'm not the one working at sap!!
but we can't have anything unless we know what we're supposed to do :)
 
I'm just a fraud man
i was working at Sybase
 
yea right lol
 
10:39 AM
and Sybase got eaten by SAP ;)
 
first gif of room!
 
starred !
 
though not what i was looking for!
too bad i can't star my own thing :D
anyways.. @DotNET what are we looking for?
my office has a disaster in progress
i'm eating cheese puffs!
 
that good
all should just burn
 
lol no seriously
 
10:43 AM
dude you can't imagine...
i'm so ashamed of myself...
 
i'm not involved - but the infrastructure engineers are having a manic day
 
I didnt do a great job on this project...
 
somethigns happening with our ESX hosts!
 
wooch
your SEX hosts ?
sounds hot
 
yea ! thats what i meant :D
 
10:44 AM
:D
I think we lost .NET
he did not include the WPF.MDI in his project right ?
 
yea he didn't
i just downloaded it
 
that's a noughty boy
 
probably didn't even occur to him that his uni thesis is running from different locations :D
i can haxx0r his box now - i knows his C$ paths
 
yeah
go on
destroy him
MUAHAHAHAHAHAH
I need some rest T-T
 
if I destroy .net - what will i code on! :D
 
10:47 AM
come on
 
what you need is a vote up!
to get past that 500 block
 
we'll code in machine language
don't be a pussy
and we'll rule the world once again §
yeah
that's frustrating, I'm so close to 600
 
hey sorry guys
 
hey .NET so you weren't dead after all
we shoulda know, .NET is indestructible
 
exactly :)
WPF MDI wasnt included in the project?
 
10:49 AM
no
you suxx man
 
Looks like it :/
shame on me :p
 
jk :) It's okay we got it
 
ok great :)
 
so you need the render size of inner windows right ?
 
ye, basically I want the MdiChild's size to enclose on its contents
like the window SizeToContents property
only way i thought of was to set the MdiChild height and width to the hieght and width of the DatabaseTable
 
10:51 AM
ok a,d as there is no such functionnality on WPF.MDI you want to code it yourself , and thus, you want the size of the content
 
exactly :)
 
there! you're in 600s now
 
mmmmokay
LOL
thx dude :D
 
np - upvote what i learn from
and it easy to go through your answers and learn something!
@Sisyphe I'm still clueless!
what does he want?
 
well
his project is a MDI project
there are object calledMdiContainer if i remeber right
that can be used as inner windows
and have a content
 
10:55 AM
yea
 
sadly
 
i have it
 
these items do not have a property SizeToContent like the WPF Window
ok ^^
i'll let you dig a bit on it I have to finish something first
 
umm
 
my code is giving me a hard time
 
10:56 AM
Basically what Sisyphe said - I've got an MdiChild object which is wrapped around a user control which I created. And I want the wrapper to take on the same size as its contents
i.e. the user control
 
it's not that hard to solve actually, jsut have to find the right entry point, get RenderSize and do on binding on it
 
ok i think i got it now
 
well i was wrong, not the MdiContainer, but MdiChild
 
out of curiousity: why did you use code behind for mdichild?
yea i figured
 
So that the sample project would be like my main one - in my main project it has to be in code behind as it's completely dynamic
the sample project is basically simplified
 
11:03 AM
<Window x:Class="TestApplication.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:MDI="clr-namespace:WPF.MDI;assembly=WPF.MDI" xmlns:TestApplication="clr-namespace:TestApplication"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Title="MainWindow">
	<MDI:MdiContainer Name="mainContainer">
I WIN (Shao kahn style)
 
damn it
 
there goes another of my answer credit
i'll be in my 1300 block for a very long time :D
 
I'll try it out :) If it works ill open a question and you can post the answer there
 
it works on my pc - so should on yours too
i killed your code behind btw
 
is it possible to do this in code behind though?
 
11:05 AM
so use this xaml only to add the child
sure.. just use setbinding
sisyphes previous answer to one of your question has SetBinding in it
though you really should do this through xaml
for its the wpf way
 
you're such a badass
 
a lot easier to read / write than to navigate codebehind
nah
 
brb, afk for like 15 minutes. I'll try it when i come back :)
 
i wish I had time to try :'(
 
it was easy.. once you realise mdichild is just a uielement :)
 
11:08 AM
yeap not a big deal
 
something is screwing up intellisense
i can't see the properties so i had to do it out of faith
 
that's the advice I gave him
 
vs refuses to recognise mdiChild
see you're badass!
 
but i was advicing binding on ActualHeight and ActualWidth
 
anyways.. must jet for now
i did that
 
11:09 AM
i'm surprised it works on Width/Height
 
ActualHeight reduces it down to nothing
it breaks on Actual
 
ho I see
 
but that was my first point of entry
AW works - but AH doesn't
so i switched to w/h
catch you guys in 20-30 minutes
 
ok ^^
see u then
 
11:37 AM
back
 
same here
 
wb
 
you too :)
 
cheers
 
ill try out your code in a few minutes hopefully - just trying to solve a problem first
 
11:43 AM
oh hey @BademYüce
 
back
 
wb
 
wb :)
 
I'm thinking about inviting people to this room that ask wpfy questions in c# room
 
yeah definitely
0
A: Bind the tab header to a property from code

SisypheThere are many ways to set bindings from Code Behind. What you should try to bind is the HeaderProperty on the TabItem. Though you must first retrieve it to do that. Here is a working example that should set you started. It's not the way I would do it, as I would do that in xaml, but as you req...

 
11:47 AM
though the two i invited, haven't responded at all
 
i can't believe people trying to force use of code behind
 
they'd rather sit in that room waiting than join here - weird people
 
xaml really scares people
 
this guys asking about datagridcolumn and i invited him over
yet we don't see him here :)
i'm gonna let him wait!
 
weird :/
 
11:49 AM
actually, you're on c# right?
yea u are
leave this room, and let me invite you
lets see how it works
 
hello
Just so you know, with reference to my question I'm using WinForms
 
hi there
 
aaa
 
understandable then
 
well some of us have done that too :)
too bad markus isn't here
but still.. lets take a stab!
 
11:52 AM
:)
I was expecting that when the datagrid detected one of my properties as a windows uri, it would automatically set the column type to datagridviewLinkColumn
 
guess its no wpf :P
 
wpf does this automatically?
 
it does format most columns correctly
though i don't think we have a link column by default
anyways, are you auto-generating columns?
 
yes.
if I dont autogenerate them and bind them at runtime will the dataGridview still update when my bindingList is modified?
 
now thats a question i haven't dived into myself
but if you want it to different from string column - u need to tell it yourself
 
12:01 PM
hmm okay.
do you guys hang out here often?
 
I'd imagine it to work with bindinglist though
yea
sis and I are permanent residents in working days
other people come and go
 
:)
 
this is a relatively new room, so we're trying to raise awareness and get people to join
hey @IvanKlaric
 
@Maverik - if i may interrupt for a second - your solution seems to work, but i've somehow lost resizing functionality. Rather the resizing mechanism isnt working as it's supposed to anymore
 
interesting!
well
i'd imagine its because of binding
it kinda makes sense
 
12:07 PM
This is what ive done:
var x = new Binding("Width") { ElementName = "tableWindow" };
var y = new Binding("Height") { ElementName = "tableWindow" };
childTable.SetBinding(FrameworkElement.WidthProperty, x);
childTable.SetBinding(FrameworkElement.HeightProperty, x);
 
MAverik, you're so bad
 
sec.. checking a theory
i suxx0rs
 
try One way binding ;)
 
yea its definitely due to binding
guess we can't bind then
 
Looks like it :/
 
12:11 PM
apparently even a code-behind fails
 
one way binding does not solve the issue ?
 
so my guess is mdiChild has some form of internal referencing going on that we're overriding
nope..
 
one way or one way to source (i'm not reallyinto the code so i'm just throwing generic ideas :D )
 
no binding - not even a simple value assign
 
ho
yeah that's a problem :D
 
12:11 PM
as soon as you assign anything to width /height - resize dies
 
hmmm
try this
set Width/Height to NaN on broder click ?
 
an interesting effect
if i set the mdiChild.width = double.NaN - it gives you size to contents
though resize is still dead
 
hmm
 
Honestly, the more I help with this project, the more I feel you should use standard wpf stuff
this is so not right!
of course we can probably find another work around
 
Well the library's code is completely editable so i guess i can change some things
 
12:15 PM
but we're about to work around a work around!
@DotNET that might be true, but you have no idea of the ripple effect it'll cause
 
Actualy, if that was me, I would rewrite it
 
I guess so, but this is what ive lumped with so i dont have much of a choice :P
 
it's not that big
 
@Sisyphe feel free to fix it and drop a pull request in ;)
 
12:28 PM
Unfortunately I don't have time to re-write it. Coincidentally I discussed this issue with my supervisor yesterday, and due to time constraints, fixing the library or even changing it should not be an issue.
The application is to be very AI heavy, and as it is i know nothing about AI so I need time to learn some concepts and code them. Basically what I'm trying to say is that I have very limited time which can be spent on the UI of the application
 
@DotNET I wish you best of luck! considering the library isn't following wpf norms... this could take ages potentially
my best guess is that mdi, is overriding controls width property
 
well actually I have a personnal project
called NWorkbench
that does the same thing
just better :P
 
it doesn't seem to act like a DependencyProperty that its supposed to be!
 
Ye exactly, hence all this wasted time spent on trying to get small UI-specific things to work out :/
 
ok heres an interesting thing
mdiChild.height = 300 is coming from a style
so it is a dependency property still
 
12:35 PM
:D
you guys are digging hard :D
 
Interesting... maybe that's why its acting up. The last time i tried to solve this problem i had searched through the classes and checked to see if it was specifically being set, but couldnt find anything
 
I just snooped to see what it was set to that i was overriding
well aparently its an implicit style - so will have to dig through library source to see how is it doing it
 
Would you like me to send you my template?
 
and since this is happening through style, we could probably modify it to connect to its child
nah need to see library source first
 
Ok - just to let you know that i've modified the Aero.xaml file
mine is quite different to the one provided by the library
 
12:55 PM
well did you find the relevant template?
set element binding on it like i did above
 
What i mean is that i've modified the file in the past, not now :) Just to let you know as the code is different to mine
 

« first day (7 days earlier)      last day (4142 days later) »