DevExpress DockPanel Width - winforms

I can't change the size of this damn control not even god wanted me to! I've tried https://www.devexpress.com/Support/Center/Question/Details/Q458946, https://www.devexpress.com/Support/Center/Question/Details/B96266 and https://www.devexpress.com/Support/Center/Question/Details/B193170 without success...
My big probem here is that, if I SET "AutoSize", when a panel get hidden by "AutoHide", it WONT be visible again. If I disable "AutoSize" the panel shows up again, but its size will be off...
Any ideas? im really lost here... and I do belive that this is a bug...

I've managed it... the problem was the incapsulation regarding XtraTab regarding the docking of the inner UserControl that contains the other control of the dock, since DockManager needs a ContainerControl the function properly... note that IContainerControl from Control.GetContainerControl() is not enough...

Related

WPF : The toggle button in my GridViewToggleRowDetailsColumn get visible when scrolling horizontally

I have a radgridview with a GridViewToggleRowDetailsColumn and I can set the visibility of the GridViewToggleButton the way I want through the RowLoaded event for each row. It was working fine until I need to scroll horizontally. When the GridViewToggleRowDetailsColumn get out of the screen and I scroll back to it, the GridViewToggleButton are now all visible.
I tried to find any event triggered by this without success. Even the IsVisibleChanged event attached to the GridViewToggleButton seems to be triggered only on the visible one.
Does anyone faced the same issue or have any idea of what could produce this behavior ?
Edit: Found the answer. It was a virtualization issue. Adding EnableColumnVirtualization="False" in the gridview properties solved it.
https://docs.telerik.com/devtools/wpf/controls/radgridview/features/ui-virtualization
After a few minutes of research, it appears that telerik WPF GridView uses virtualization to improve performace. This means that the state of what is in the screen is retained and as things leave your viewing area they are destroyed. This frees up memory space significantly, however can have some side effects as you are experiencing.
You can set EnableColumnVirtualization=false however Telerik has provided a help article that will likely answer your question more directly while not sacrificing the performance provided by the virtualizations. A link is below and following through the steps, it looks fairly straightforward.
https://docs.telerik.com/devtools/wpf/controls/radgridview/style-selectors/cell-style-selector
The recommended approach for customizing this behavior, and not turning off the virtualization, is to use a custom column. Try inheriting from GridViewToggleRowDetailsColumn and override CreateCellElement. It is the callback for creating the visual element in the cell, which is called, more or less, at the same time as RowLoaded. Then return null for those rows that you don't want to have a button for.

How to change the View Mode of DocumentViewer

How can I change the View Mode of DocumentViewer?, I want the page to be full width since the beginning.
If I use documentViewer.FitToWidth() it does stretch but not completely.
If I use ctrl+2 it stretches completely and thats what I want to achieve programmatically or using xaml if possible.
Thanks
I found the problem.
I used FitToWidth() too early (right after documentViewer.Docuemnt = document), I changed it - now I call it after the documentViewer loaded and it works fine.
I guess it was my fault - I dont understand why it stretches it almost completely when I call it right after I load document but w/e as long as it works.

Stop loading controls in a Wrap panel once it's "full"

In one of my previous apps I needed to add controls to a flowlayoutpanel in a winforms project dynamically, but I needed them to stop loading once there was no more room in the panel for them to fit.
To achieve this I wrote: https://github.com/LucasMoffitt/WordFiller/blob/master/WordFiller.Controls/WordLayoutPanel.cs
This basically just sets a property to false if an inbound control touches a rectangle I draw at the bottom of the panel.
While trying to replicate this behaviour in WPF I can't find any way in which I can force a WrapPanel to stop taking in controls if it's full.
I've attempted to override the Arrange and Measure methods but they only get called once all the controls have been added. I need to be able to stop the controls from being loaded at all.
Anyone have any ideas?
So I ended up taking in some suggestions and arrived at this:
https://github.com/LucasMoffitt/CustomWrapPanel
basically it's what I was doing to begin with just a little tidier, and has a demo app.
I encourage all contributions if anyone finds a nicer way of doing it!
You could check ActualHeight/AcxtualWidth against DesiredHeight/DesiredWidth. When DesiredHeight becomes larger than ActualHeight - the panel began overlapping.

Detect end of ScrollView programatically in Silverlight?

I am new to WPF and I am having some issues with this.
I have a ScrollView and a RepeatButton. I want to disable the RepeatButton programatically when the ScrollView has moved all the way left or all the way right. Is there an easy way to do this in Silverlight?
I found this page: http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.scrollchanged.aspx and was thinking of adding an event listener for this, but I don't know if that is the best way to tackle the problem.
Thanks guys! Please let me know if you need code samples or anything.
Probably you want to look at the HorizontalOffset and the ScrollableWidth or Vertical/Height respectively.
if the Offset is equal to the Scrollable dimension, then you don't want to display it... Personally I'd leave it though because what you're suggesting isn't really standard behavior, which is not usually good because the the user does not expect it.

Dynamic Drop Shadows in WPF?

Ok I feel like I am just missing something small here, but it has taken me too long to figure this one out.
I have a custom UserControl that has a drop shadow. This UserControl is then used as the view to create a ModelUIElement3D. The drop shadow works perfectly when first displaying. The trick here is that I want to be able to change the direction of the shadow programmatically.
I have set up a binding to the ShadowDirection property that I know is working correctly, so I am left to believe that the problem lies in my view not updating. I have tried to invalidate the ModelUIElement3D, the UserControl, and the Window they all sit in, but have had no success.
Anyone know where I might be going wrong?
Thanks in advance.
Rick
Does the object to which ShadowDirection is bound implement INotifyPropertyChanged?
If not, the UI will never pick up changes from the bound object.

Resources