AvalonDock, check docking content - wpf

I need allow or no docking according the content.
For more detail, I use some DocmentPane with some DocumentContent. I want allow the behaviour floatting for the DocumentContent, but i dont want allow DocumentContent change DocumentPane. DocumentPane can only redock on original DocumentPane.
I dont know how process. I dont find drog event to check and accept the content. My DocumentPane is herited class, else i can overwrite some methodes. But DocumentPane dont have virtual Drog method.
Thank for your helps.

Related

WPFToolkit / AvalonDock / Event

What I like to have:
A Dashboard which the user can realigned/move/resize a board with Drag&Drop ability.
The easiest solution could be perhabs to use simple dock windows like AvalonDock. But because I don't like floating windows, I must be possible to automatic re-dock the floating window if the user don't dock it.
What I tried:
I found in LayoutContent.Dock the method, which I need to call when the user stops dragging the floating window. I think, after LayoutFloatingWindowControl.FilterMessage -> case Win32Helper.WM_EXITSIZEMOVE: would be the best place. But after this point I found no event to notify me. Do I didn't see the solution? Next problem: How can I get the object of type LayoutContent to call Dock? :/
Can I continue to pursue my idea?
Or did you know other free controls or ideas to realize this?
Thanks
AvalonDock LayoutDocument and LayoutAnchorable (the controls that hold the content) have a property CanFloatset it to false and it will not be able to float and you don't need to dock it.
see the docs: https://github.com/xceedsoftware/wpftoolkit/wiki/AvalonDock

Custom xaml markup template for user control

Is it possible to customize default user control markup in xaml ?
Let's say i have a user control named MyUserControl.
What I would like to know - is it possible, when I type
<controls:MyUserControl -and then type- >
instead of just ending up with
<controls:MyUserControl ></controls:MyUserControl>
to have
<controls:MyUserControl DependencyProperty="1" DependencyProperty="Person" ... ></controls:MyUserControl>'
Basically I want to create a custom template that would be used when auto-completing user control in xaml editor.
Purpose is to show the user available properties right away ( user that wants to use some control that he did not use before can see how to change important properties without browsing all possible properties on user control )
As far as I am aware, there is no simple way to do that, but I'd say that it was unadvisable to try to do that anyway. You said that you want to show the user available properties right away, but that is what Microsoft's Intellisense in Visual Studio is for. Once you have declared your DependencyPropertys, they'll automatically appear in a popup when a user is using your class.
As the .NET controls do not do what you suggest, then yours shouldn't really do that either. You're more likely to confuse developers with this unusual behaviour and they might even leave these added and quite possibly unwanted properties because they don't know any better. Your best bet to help users of your code is to implement it in as standard a way as possible, so that everything will work as expected.
You know, the most annoying bugs are caused from problems with code that was meant to help us.

GtkColorChooser vs GtkColorSelection

(Jacked straight from my last thread:) Reading through the GTK Book, there are lots of things to clean up when making sure to learn GTK3-focused skills. One is color selection widgets.
First, I'm wondering how GtkColorChooser is supposed to permit alpha choosing. The book just has you gtk_color_selection_set_has_opacity_control (GTK_COLOR_SELECTION (colorsel), TRUE);. There's a similar function for GtkColorChooser, but it doesn't seem to create anything. There's also the show-editor attribute that I flipped to TRUE without seeming to do anything.
Second, is there an equivalent notion to GtkColorSelectionDialog->colorsel for GtkColorChooserDialog? As in, can you access the GtkColorChooser widget from the parent dialog?
EDIT:
This is the source for the dialog creation where I'm missing something. I'm expecting this to show me an alpha-enabled color chooser widget, but it only gives me the regular swatches.
dialog = gtk_color_chooser_dialog_new(title, window);
gtk_color_chooser_dialog_set_use_alpha(GTK_COLOR_CHOOSER(dialog), TRUE);
My only guess is that I'm trying to access the color chooser incorrectly, but I haven't been able to find sufficiently detailed instructions about how to get to the chooser from the dialog.
the GtkColorChooser interface allows choosing the alpha channel by setting the :use-alpha property:
https://developer.gnome.org/gtk3/stable/GtkColorChooser.html#gtk-color-chooser-set-use-alpha
when the :use-alpha property is set, you can select the alpha when creating a new custom color in the editor; a new scale widget will appear at the bottom of the color editor and will let you select the alpha level:
the GtkColorChooserDialog is a GtkDialog with a GtkColorChooserWidget inside the dialog's content area, so you can use gtk_dialog_get_content_area() and then get the first child of the returned GtkBox. this is arguably a layering violation, and should not be needed: GtkColorChooserDialog proxies all the GtkColorChooser methods to its GtkColorChooserWidget, and you should never need to access the widget directly. if you want to keep control of the GtkColorChooserWidget, you should create your own GtkDialog and pack a GtkColorChooserWidget into it yourself. again, I would not recommend doing that unless you want to create your own custom dialog.

WPF Printing large custom control

I'm sorry if this is a duplicate, but I couldn't find anything relating to it.
I'm trying to create an XpsDocument from a custom control that I have. The custom control already defines properties for a header and a footer, along with the body.
The idea is to be able to use that same control (or derivatives of it) as an input to some custom DocumentPaginator that will create a printer-ready version of that "report", with the header and the footer put on every page, and the controls, inside the body, showing in full (I don't want to create a bitmap of the whole control, then scale it and cut it where the page ends).
Any ideas on how I can split the contents of a user control into pages?
Or suggestions on a different way to achieve the printing of the control onto pages?
Thanks a lot in advance
Check of VisualDOcumentPaginator;
http://www.codeproject.com/Articles/164033/WPF-Visual-Print-Component

Forcing Arrange in a Custom WPF Canvas

I'm working on a project that involves creating a custom graphical editor. The graphical editor has multiple tabs, and I want to create a preview function that will show a popup with Bitmap previews of the content of each of the tabs. However, the problem I'm running into is that the content for each of the tabs must be arranged before a proper preview can be generated for it. This means going into each of the tabs to ensure that they're rendered and arranged. Then, and only then, do the previews get properly generated, otherwise the previews have a size of 0x0. Does anybody know how to force an arrange of a content control so that I can get a properly sized preview generated ?
Apparently you can just call the 'Arrange' method directly, but you have to be careful about the rectangle you pass in as a parameter, because it can adversely affect the display of your control if you just want to force the object to draw itself (ie can force it to draw out of the desired position).
Here is a link to MSDN where it discusses the "arrangeOverride" method of a control.
I'm not sure this is what you need, but this method seems to be what you're asking about.
Hope this helps!

Resources