I am trying to get the size changed event for a floating only window and I guess I am not using the right events or this is a bug.
I have tried to wire up the SplitPane, ContentPane and even the actual content (in this case a web browser control) using the SizeChanged events but when I resize the floating windows none of the SizeChanged events get fired.
Am I doing something wrong or is this an issue with the control?
Thanks
SizeChanged is a direct routed event fired by the WPF framework for FrameworkElement when the RenderSize is changed. So as long as you hook that event directly on the element (ContentPane, HwndHost, PaneToolWindow) then it will get invokved when that property is changed which will (and in my test did) occur after the window was resized. Can you post a small sample that shows the problem?
Ok, had to do some testing to figure out why it does not work in my application and found out that if the floating only splitpane is collapsed when the application is started and then shown later the sizechanged events do not fire. A demo of this is attached.
Please let me know if you see this as a bug also.
You have 3 methods defined but nothing is actually attaching the SizeChanged to any of those methods (i.e. you're not actually listening to any events). When I attach the events, I get them raise for the SplitPane and the ContentPane as you resize the window. You won't get them (except the initial time) for the WebBrowser because you have an expicit Width/Height so its Width/Height is never changing after the initial sizing.
OOPS! I just noticed that the test project that I sent did not even have the events declared in the XAML.
OK, Some time while I was trying to figure out why it does not work in my application I must have deleted the event mappings from the XAML.
I will have to work on this some more because when I do the same exact thing in my development application it does not fire the events.
I will get back with my findings.
Ok, I see what you mean about attaching the events. I have not had to do this to any other event that I have declared in the XAML.
In fact when I have done this without declaring it in the XAML with other events from infragistics wpf controls I had problems that the events were not raised.
So with that said which is the proper method with the Infragistics controls to handle the declarations of the handlers in XAML or in Code behind with the handles keyword or both?
I knew about the webbrowser size event not being raised due to the height/width settings but if I do not set those then I get a splitpane window that fills both of my monitors and is offset down and to the right so that I do not see the right side or bottom of the window. I just put it there prior to setting the size of the webbrowser.