UIElement is a base class for most of the objects that have visual appearance and can process basic input as part of the user interface.
Questions tagged [uielement]
404 questions
2
votes
1 answer
How to copyclone a UIElement and keep the layout/render information?
I wish to copy a complex data-bound UIElement but keep the Binding, Layout and Rendering information from the original UIElement.
Creating a new UIElement seems inefficient since I would have to do another complete Binding/Measure/Arrange/Render…

Peter
- 364
- 5
- 17
2
votes
1 answer
How to find out whether a mouse button is pressed when mouse pointer is leaving a UIElement
I've been working on a GUI in WPF which I'm fairly new to, having only used Windows Forms up until now. So far, my GUI is very simple: it contains two rectangles, each of which drops a shadow. The shadow creates an effect of rectangles "floating…

Phonon
- 12,549
- 13
- 64
- 114
2
votes
2 answers
Dynamic and Immutable UIElement Arrays
I have a WrapPanel that contains multiple Canvas of the same size. Each Canvas has some UIElements (i.e. TextBox, TextBlock, Buttons etc) as children. The creation of each Canvas (including its UIElement children) and the number of Canvas to be…

KMC
- 19,548
- 58
- 164
- 253
2
votes
0 answers
UWP How to programmatically set the touch target size of a UIElement
I have a button very small (18 x 18 pixels) and I would like to programmatically extend its touch target size.
Is it possible?
How?

Cristiano Ghersi
- 1,944
- 1
- 20
- 46
2
votes
0 answers
How to display the main menu when Dock icon is hidden?
I developed a basic menubar app. How do you hide the dock icon and still have the Main Menu display when menubar app (status-item) is active?
Note: The Main Menu only displays If the dock icon is not hidden.
e.g. Main Menu (File, Edit, View etc at…

dbrownjave
- 437
- 1
- 8
- 19
2
votes
2 answers
Highlight or outline any UIElement in adorner layer
I would like to be able to somehow outline or highlight any particular UIElement (or perhaps even Visual) in an adorner layer. Adorner is not a problem per se. I am more concerned about creating an outline of a UIElement.
I am aiming at a similar…

wpfwannabe
- 14,587
- 16
- 78
- 129
2
votes
1 answer
Cocoa status bar (UIElement) app settings window
I got it all working, but when i click on the settings, the settings window (in nswindowcontroller) opens up on the back of other apps running on my mac. I want it in the front so user can see it when he clicks it.
Thank you all!

Kukosk
- 2,892
- 1
- 27
- 30
2
votes
2 answers
C# Unity dropdown, on change calling a function, function query list return matching list items
One of those simple ones where my head is just blocked. I'm used to coding in php and mysql and I just can't figure out the simple syntax in c#.
I have a list which holds business listings as my Item class is structured below. I have a dropdown in…

Diego
- 371
- 1
- 3
- 13
2
votes
1 answer
At what stage in the life-cycle of Silverlight UIElements do existing Bindings get removed?
I'm trying to work out why some of my Silverlight controls are staying in memory. I've noticed that when I navigate away from a page with the controls on, there remain referential links to the view model. These links are a result of left-over…

Stephen Ellis
- 2,561
- 2
- 24
- 47
2
votes
1 answer
Select a WPF UIElement in a FlowDocument
I have a FlowDocument (inside a RichTextBox) that contains UIElement controls such as CheckBoxes. I need the user to be able to click on the CheckBox to select it to change the controls properties such as label, background color etc.
The problem I…

dgwyer
- 739
- 8
- 19
2
votes
1 answer
Raising RoutedEvents in non-UIElement class
It seems that the entire power of routedevents is directed towards UI development.
Meaning to ask, would it be possible to raise a routed event from a class that does not extend a UIElement or UserControl class at all? For example: I create a State…

dansam100
- 23
- 3
2
votes
1 answer
GPUImageUIElement overlay size
I'm trying to record a video with some overlay text using GPUImage library. Recording with overlay works so far, but I can't achieve the overlay to have proper size. No matter which frame I use by initialization, the overlay view is always take the…

Andrey Gershengoren
- 896
- 1
- 5
- 18
2
votes
1 answer
Generating Bitmap of WPF UIElement in ASP.NET
I'm trying to generate a bitmap off a WPF border. The whole thing sits in a asp.net app (server side of course) running .net 4.0.
The problem is, that the generated image is, well, empty. Does anyone have an idea why?
Here's the code.
public static…

Dänu
- 5,791
- 9
- 43
- 56
2
votes
1 answer
Prevent ScrollViewer from handling Mouse Wheel Event
Is there a way to prevent a ScrollViewer from handling mouse scrolling?
The following code isn't sufficient, because the event shall be handled by a child element of the ScrollViewer instead:
private void ScrollViewer_PreviewMouseWheel(object…

Henste93
- 273
- 4
- 21
2
votes
2 answers
Casting error for UIElement on runtime
I get runtime error when I do this.
I have this class:
public abstract class AnnObject : DependencyObject
and when I do this it compiles fine, but throws a runtime error...
AnnObject aa;
var b = (DependencyObject)aa;
var c = (UIElement)b;
The…

VoodooChild
- 9,776
- 8
- 66
- 99