FAQ Database Discussion Community


WPF C# Set “ContentPresenter.Foreground” by code

c#,wpf,foreground,contentpresenter
I could only find xaml specifiy solutions to this problem using TextElement.Foreground="...". But I'd like to set the Foreground of a ContentPresenter in C#. Can you tell me how that works? Thank you very much!

Bring a UI Element to foreground

user-interface,unity3d,drag-and-drop,foreground,topmost
I would like to implement simple drag and drop with: public void OnDrag (PointerEventData eventData) { transform.position = eventData.position; } The problem is that when i begin the drag, I want to bring the UI Element to the foreground. by doing something like this: public void OnBeginDrag (PointerEventData eventData) {...

Lost Gray On IsEnabled False

.net,wpf,foreground,isenabled
Once I set the TextBlock Foreground Property then I lost the gray on IsEnable=False on buttons and also lost the gray on ToolTip. How can I set a the style for TextBlock foreground and not effect the IsEnable=False and ToolTip? <Style TargetType="TextBlock"> <Setter Property="FontFamily" Value="Segoe UI Semilight" /> <Setter Property="FontSize"...