All Questions
308 questions
1
vote
1
answer
96
views
On button hover, textblock needs to display some text in c#
I have a button. On mouse hovering on the button, a textblock used in my project should display some value. Button is defined in the library and that library I am using in my project. In my project I ...
0
votes
1
answer
76
views
Interaction Trigger with condition
Is it possible to Invoke a command action conditionally?
Basically I have created a Custom control (DialogHeader) which I am going to use for all of my DialogWindow Headings.
In some of the ...
0
votes
2
answers
70
views
Trigger event when Combobox contains only one item
I need disable a combobox whenever it contains only 1 item.
I spent a fair amount of time reading the documentation on the microsoft website, but I cannot see any trigger for this type of events.
Is ...
-1
votes
1
answer
49
views
C# WPF Buttonproperties when mouse hovers or clicks it
I'm trying to make my button theme react to the mouse. So when I hover over the button it should be gray and when I click it, the button should change the color as well. If tried to write my own code ...
0
votes
1
answer
415
views
Make element visible when Validation.HasError is true
I have the following xaml markup:
<GroupBox Margin="10" Padding="20" Header="Case 5 - Custom Error Object">
<GroupBox.DataContext>
...
0
votes
1
answer
733
views
WPF | MultiDataTrigger and Binding to the same property
I'm working on the next task.
There are some class and enum:
public enum Status
{
Running,
Canceled,
Failed,
Completed
}
public class Result
{
public Status Status { get; set; }
...
0
votes
1
answer
373
views
Trigger in code-behind updates border but not button
I have a style that is updated dynamically in my C# code. It applies to a few buttons and a border. This way I can change the theme of every item by simply setting the style background property.
...
0
votes
0
answers
57
views
ListViewItem Trigger messed up the ListView
I have already tried googling this problem, but just couldn't find a solution.
So my problem is that when putting the trigger into the code, it just messes it up, or to be more exact, the data I ...
1
vote
1
answer
529
views
How to set a condition for the background color of a CheckBox in Mouse Over state?
I needed a CheckBox that acts as follows
Unchecked - The default style is applies
Checked - The background is blue and the check mark glyph is white
I created a template like this:
<Application....
1
vote
2
answers
922
views
Can you temporarily disable/override Control Template Triggers in WPF?
I'm setting the BorderBrush of a TextBox if I input invalid Text in it:
if (!Regex.IsMatch(txtAddName.Text, @"[^A-Za-z0-9|()& ]"))
{
txtAddName.BorderBrush = regularBrush;
}
else
{
...
0
votes
1
answer
72
views
Skip storyboard cleanly in ControlTemplate
I have a Style for a ToggleButton which defines a ControlTemplate. My ToggleButton is animated when it changes states, but i don't want it to animate when i navigate to a new page. So, i added an ...
0
votes
2
answers
2k
views
Using WPF Triggers to Change Properties of Named Elements in UserControls
Suppose I have a Window or UserControl with a boatload of named elements. I want to change all these elements' property values based on a single property of either my view model or a custom DP on the ...
0
votes
2
answers
635
views
Button's trigger IsMouseOver stops working after button's background is set in code-behind
I want the background of a button to change when the cursor hovers over the button.
I have managed to do this in a style which use the "IsMouseOver" trigger which sets the button's ...
0
votes
1
answer
90
views
Accesing parent elements in WPF C#
I have a problem to reach a button which is not in the same grid as event trigger.
In one grid we have a trigger:
<Grid x:Name="BottomGrid" Margin="0, 30, 0, 0" >
<...
0
votes
2
answers
82
views
How to change Color Inside a Window.Resources C# WPfF
I want to change the color of items inside the Windows.Resources when click a Button.
<Window.Resources>
<DataTemplate x:Key="Listboxcmmt">
<Border>
...