uielement

DocumentPaginator that works with any Visual? [closed]

☆樱花仙子☆ 提交于 2019-12-10 15:58:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Printing any visual is easy. Printing one that is larger than a single page is hard. I'm stuck. The docs are scarce and I've gotten as far as I can. I'm wondering if anybody has a class which extends DocumentPaginator that can take any visual (or even a UIElement) and split it across multiple pages. I attempted

How do I make a Deep Copy of a UIElement?

拜拜、爱过 提交于 2019-12-10 15:15:34
问题 So I have a printing component that serves a Silverlight application. Other modules in this program have the ability to signal the printing component and pass it a UIElement , which the printing component will then draw to the screen. All well and good. The problem arises when I try to manipulate the UI Element in order to better format it to fit the user's selected paper size or anything to that effect; it seems that the UI element that is passed in is frequently the exact same instance of

How to make <UIElement> interactable or click-able in WPF UI

孤者浪人 提交于 2019-12-09 13:03:27
问题 This is my first day to design UI using WPF. I have looked up MSDN official document of Flow Document and found that I can place an UI control inside a RichTextBox . I did put a button in but found it's not interactable - I cannot click on it as it's grey. And I also tried other controls and they all displayed fine but just don't support interaction. Even a hyperlink doesn't work. I have searched over internet, the closest question ever asked is about how to make an inside hyperlink click

Generate BitmapSource from UIElement

限于喜欢 提交于 2019-12-09 06:52:35
问题 I am attempting to generate a BitmapFrame that is based on a UIElement . Here is my function: private BitmapFrame RenderToBitmap2() { RenderTargetBitmap renderBitmap = new RenderTargetBitmap(200, 200, 96, 96, PixelFormats.Pbgra32); DrawingVisual drawingVisual = new DrawingVisual(); DrawingContext drawingContext = drawingVisual.RenderOpen(); VisualBrush aVisualBrush = new VisualBrush(GenerateTestStackPanel()); drawingContext.DrawRectangle(aVisualBrush, new Pen(Brushes.Green, 2), new Rect(new

How to clip Image (UI-element) to sample geometry?

岁酱吖の 提交于 2019-12-08 07:06:51
问题 I want clip Image to ellipse, for example. UI-element have Clip, but Clip in the Windows Runtime API must be a RectangleGeometry. I can achieve the same result using an Ellipse and ImageBrush element as Fill brush: How to clip image to ellipse in XAML But then i can not size or move my image, because it's brush, not UI-element. So, how clip image not rectanglegeometry? For example, i want this:Move image into ellipse Maybe, i can use alphamask to UI-element? Or OpacityMask? Maybe this is

Silverlight: How to Make a ShallowCopy of a UIElement

我怕爱的太早我们不能终老 提交于 2019-12-08 04:24:02
问题 I need to add a UIElement to two different canvases, but one UIElement can only be a child of ONE canvas, so I have to create a ShallowCopy (DeepCopy not needed) of the UIElement . I want to use MemberwiseClone , but it's protected, I cannot use it. I also want to define an extension method UIElement.ShallowCopy , but it sill still call MemberwiseClone , which is protected again. EDIT: Tried all the following, but all of them failed in Silverlight environment: // System.Runtime.Serialization

How can I make UIElement support binding?

偶尔善良 提交于 2019-12-07 17:43:39
问题 DependencyProperties on UIElement s do not support databinding (you get something like: "Cannot find governing FrameworkElement..") . If you try, you get an error because WPF can not resolve the DataContext. From what I know, you get binding support if you inherit FrameworkElement or Freezable, but In this case I can not simply change the base class. Is there any way to get the UIElement to support data binding? I've tried to add the DataContext property to the UIElement class like this:

UIElement vs FrameworkElement in WPF/Silverlight

守給你的承諾、 提交于 2019-12-06 18:21:24
问题 When do I derive from UIElement and FrameworkElement considering FrameworkElement inherits UIElement . Can anyone give real life examples? 回答1: This is a good page for learning about WPF Architecture, and this answer only applies to WPF. Check out the UIElement and FrameworkElement sections, as well as the rest if you have time. Here's a quote from the linked page explaining why the 2 levels exist: To this point in the topic, "core" features of WPF – features implemented in the

JavaFX application hide OSX dock icon

你。 提交于 2019-12-06 04:37:49
I need to hide the dock icon of my javafx application. In a normal java application this can be achieved by the following property: System.setProperty("apple.awt.UIElement", "true"); However, this does not seems to work with JavaFX. Thanks! Just tried it. You have to modify *.app/Contents/Info.plist and add <key>LSUIElement</key> <string>1</string> Simple example: <?xml version="1.0" ?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>LSUIElement</key> <string>1</string> ... For me it worked on bundled

WPF Screenshot JPG from UIElement with C#

感情迁移 提交于 2019-12-04 09:59:27
问题 I'm trying to create a JPG from part of my WPF Applications. Like a screenshot, only of individual UIElement s. I started here: http://www.grumpydev.com/2009/01/03/taking-wpf-screenshots/ I am using his extension method, which essential allows you to get a byte[] with UIElement.GetJpgImage() . This can then be written using a filestream to a JPG image. If I make a JPG of the whole window, it looks just fine! However, this is not ideal because it just captures what the user sees. Things that