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
3
votes
5 answers
Find the applied ScaleTransform on a Control or UIElement?
I have a control sitting somewhere in my Window. At the root of this Window is a grid named MainGrid. I have a ScaleTransform applied on MainGrid's LayoutTransform that I use to zoom in on all the contents of my Window when the window's size grows.…

JacobJ
- 3,677
- 3
- 28
- 32
3
votes
2 answers
Set focus to UIElement (i.e. TextBox ) in XAML , using Silverlight 4?
I have only seen code solutions to this problem. I am looking for a XAML based solution and I am quiet surprised you can't set focus on a UI element in XAML.
I found this old MSDN post:…

RyBolt
- 1,764
- 3
- 22
- 34
3
votes
0 answers
Cannot convert from CustomControl to UIElement
I am using WPF, and I have written a CustomControl which inherits from a System.Windows.Controls.UserControl, but when I create a new instance of it (CustomControl), and try to add it as a children to a StackPanel, the debugger says that it cannot…

Federico Leite
- 31
- 2
3
votes
2 answers
Mouse event not reaching UIElement
I have a 6x8 grid of System.Windows.Controls.Canvas objects. The top left canvas does not receive mouse events while all the others do. I tried OnMouseMove and OnMouseClick events.
A child object isn't handling the event because…

tilish
- 1,093
- 1
- 9
- 20
3
votes
2 answers
F# upcasting TextBlock to UIElement
What is wrong with:
let (x:UIElement) = upcast new TextBlock()
The error is: The type 'System.ComponentModel.ISupportInitialize' is required here and is unavailable. You must add a reference to assembly 'System, Version=4.0.0....'
TextBlock is a…

Jules
- 6,318
- 2
- 29
- 40
3
votes
1 answer
How to stack/z-position multiple UIElements (uilabel, uiimageview, etc) on top of each other?
I've got several UI elements on my screen (programmatically) and am in need of an efficient way to give each subview a z-index setting, so I can stack certain elements over others.
Does anyone have a solution to this?

Don Wilson
- 558
- 2
- 8
- 21
3
votes
0 answers
Creating an Intelligent DocumentPaginator which is able to cut a Compex UIElement in Pages for printing
I'm currently working an DocumentPaginator which allow me to do:
PrintDialog printDialog = new PrintDialog();
if(printDialog.ShowDialog()== true)
{
var cp = new ControlPaginator(myUIElement, new Size(printDialog.PrintableAreaWidth,…

WiiMaxx
- 5,322
- 8
- 51
- 89
3
votes
1 answer
Why is the ListBox's DesiredSize.Width always zero?
I am creating a custom control in C#, and want to have a grid cell that contains a ListBox, which can be hidden or shown as desired. Hiding it is easy, I just set the Width to zero, however when I want to show it, I need to know the width that the…

Avrohom Yisroel
- 8,555
- 8
- 50
- 106
3
votes
1 answer
ios hide ui element and unblock space
I have an ui design with a pageviewcontroller in a storyboard with autolayout activated. The design consists of several labels and some images for each page. on some pages some labels should not be visible (beacause there is no information to…

Dan
- 103
- 1
- 7
3
votes
5 answers
How can I get the parent Popup for a UIElement?
I have two questions on markup below:
Why does VisualTreeHelper.GetParent(button) return null?
How can I get the parent Popup for UIElement?

altso
- 2,311
- 4
- 26
- 40
3
votes
1 answer
How do I connect UI elements to IBOutlets and IBActions?
I'm trying to connect a UI element in a window to my app's controller/delegate using the Assistant editor, but there is no option to create a new IBOutlet/IBAction when dragging from the UI element to the interface file.
The File's Owner of the…

Eliza Wilson
- 1,031
- 1
- 13
- 38
3
votes
1 answer
Unit Testing UIElements
Let me just start by saying that I'm new to Unit Testing and it's actually the first time I'm trying to do it.
I am developing an application where a user can add elements to a Canvas, select them, move them around and so on. On each selected…

Jorge Chibante
- 102
- 5
3
votes
1 answer
UIElement position relative to Window
In WPF, I want to get the corner location of a TabControl in my code, so I can set a ToolWindow's location accordingly when shown.
How do I get the location of a given UIElement?
buildingInfoWindow = new BuildingInfoWindow(); // BuildingWindow :…

Claus Jørgensen
- 25,882
- 9
- 87
- 150
3
votes
3 answers
How to write a common Event Handler for a UIElement of same type?
In a WPF application, suppose there are 'n'-number of pictures of type image and if on clicking any picture (i.e. of type image), its visibility should collapse. Now a normal way to do this would be to to write the code to collapse for every 'Click'…

Siddharth Thevaril
- 3,722
- 3
- 35
- 71
3
votes
1 answer
Add programmatically UIElement to the View in a asynchronous way
I'm actually trying to add in a asynchronous way some UIElement to my Canvas define in my MainPage.
As I understand the basic way to add UIElement to a Canvas is to add it on his UIElementCollection, for example with a Line I should do like that:
…

Yann
- 71
- 8