I have a parent user control which has a detail section and a tree section in it. My intention is on two toggle button i should be able to hide and show the controls.
<DockPanel>
<DockPanel DockPanel.Dock="Left">
<view:ListBoxUserControl DockPanel.Dock="Top" Visibility="{Binding IsListVisible ,Converter={StaticResource BoolToVisibilityConverter}}"/>
<view:TreeUserControl DockPanel.Dock="Top" Visibility="{Binding IsTreeVisible,Converter={StaticResource BoolToVisibilityConverter}}"/>
</StackPanel>
<view:DetailSectionUserControl/>
</StackPanel>
IsListVisible and IsTreeVisible is set based on two toggle button in the view.
so when IsListVisible is false the ListBoxUserControl will be hidden and TreeUserControl will move to top. this is working well.
But there are two problems here i face.
1) Requirement is that the both controls should be having same size. here the first tree will be created based on the items in it and rest of the space will be taken by TreeUserControl. How shall i make the size even.
2) When i add an item to ListBoxUserControl the control just grows and TreeUserControl size get reduced. How shall i get a scroll instead .
Try:
<Grid>
<Grid.RowDefinitions>
<RowDefinition>
<RowDefinition.Style>
<Style TargetType="{x:Type RowDefinition}">
<Setter Property="Height" Value="*" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsListVisible}" Value="False">
<Setter Property="Height" Value="0" />
</DataTrigger>
</Style.Triggers>
</Style>
</RowDefinition.Style>
</RowDefinition>
<RowDefinition>
<RowDefinition.Style>
<Style TargetType="{x:Type RowDefinition}">
<Setter Property="Height" Value="*" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsTreeVisible}" Value="False">
<Setter Property="Height" Value="0" />
</DataTrigger>
</Style.Triggers>
</Style>
</RowDefinition.Style>
</RowDefinition>
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<view:ListBoxUserControl Visibility="{Binding IsListVisible ,Converter={StaticResource BoolToVisibilityConverter}}"/>
</ScrollViewer>
<view:TreeUserControl Grid.Row="1" Visibility="{Binding IsTreeVisible,Converter={StaticResource BoolToVisibilityConverter}}"/>
</Grid>
Related
I have a WPF GUI to show AD-objects loaded and operated through PowerShell.
The GUI works as planned, but some bindings does not update their controls (mainly TextBoxes). Some controls does however work without any problem.
I get the data through the Get-AD* cmdlets and it gets stored directly in the DataContext of a Grid higher up in the hierarchy. The properties I want to list are added to the cmdlet call with -Properties "EmailAddress", .... I have also tried -Properties *, but the bindings still doesn't update.
I suspect that only the properties that are inherited from the baseobject, works with the bindings. But I can be totaly of on this.
I have tried:
different settings for the binding, i.e. NotifyOnSourceUpdate...
separating the properties through Select-Object EmailAddress, ..., but this breaks it all and no controls are shown
using a test object (PSCustomObject) with the necessary properties, this also break the controls
if I assign the values directly in code, the textboxes show the correct info, i.e. $syncHash.tbUserotherTelephone.Text = $syncHash.gridObjInfo.DataContext.otherTelephone
For the example below, the object that is put in $syncHash.gridBaseInfoUser.DataContext is of type ADUser (BaseType: Microsoft.ActiveDirectory.Management.ADAccount)
Exampel of how the object the bindings are sourced from, is retrieved
$syncHash.gridObjInfo.DataContext = Get-ADUser $this.SelectedItem -Properties "EmailAddress", ...
$this.SelectedItems is the selected item in a DataGrid. I have verified that the correct data is retrieved at both Get-ADUser
Xaml hierarchy, showing two controls, one that gets the TextBox.Text entered, one that doesn't. Some code is omitted to save space.
<Window>
<Grid x:Name="gridMain">
...
<Grid x:Name="gridMainInfo" Grid.Row="1" DockPanel.Dock="Top" Width="Auto">
<Grid x:Name="gridObjInfo">
<Grid.Resources>
<Style x:Key="PropValueStyle" TargetType="{x:Type TextBox}">
<Setter Property="Grid.Column" Value="1"/>
<Setter Property="IsEnabled" Value="True"/>
<Setter Property="IsReadOnly" Value="True"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Text}" Value="">
<Setter Property="Background" Value="LightGray"/>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Text}" Value="{x:Null}">
<Setter Property="Background" Value="LightGray" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Resources>
<!-- Other grids for other objectclasses -->
<Grid x:Name="gridBaseInfoUser" Grid.Row="{DynamicResource TypeObjInfoRowLoc}">
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ObjectClass}" Value="user">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<!-- This binding apparently does not work, so the textbox is empty -->
<Border Style="{StaticResource PropBorder}" Grid.Row="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{StaticResource PropTitleWidth}"/>
<ColumnDefinition Width="{StaticResource PropValueWidth}"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="tblUserotherTelephone" Style="{StaticResource PropTitleStyle}"/>
<TextBox x:Name="tbUserotherTelephone" Style="{StaticResource PropValueStyle}" Text="{Binding otherTelephone}"/>
</Grid>
</Border>
<!-- This binding apparently does work, so the textbox gets its Text set to the UserPrincipalName -->
<Border Style="{StaticResource PropBorder}" Grid.Row="6">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{StaticResource PropTitleWidth}"/>
<ColumnDefinition Width="{StaticResource PropValueWidth}"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="tblUserUserPrincipalName" Style="{StaticResource PropTitleStyle}"/>
<TextBox x:Name="tbUserUserPrincipalName" Style="{StaticResource PropValueStyle}" Text="{Binding UserPrincipalName}"/>
</Grid>
</Border>
</Grid>
...
</Window>
My problem is I can't set the width of a TextBox's Tooltip. The tooltip should have the same width as its containing TextBox.
please consider this code :
<TextBox Text="{Binding PatientSubStay.Observations, Mode=OneWay}" ToolTip="{Binding}" x:Name="ObservationsTextBox" MaxLength="100">
<TextBox.Resources>
<Style TargetType="ToolTip">
<Setter Property="Template" Value="{StaticResource ObservationsToolTipControlTemplate}"/>
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TextBox}}, Path=Width}"/>
</Style>
</TextBox.Resources>
</TextBox>
The Tooltip is set by a template, and my attempt to modify its Width with a setter is a failure:
thank you.
EDIT:
here is the template (it's a preversion):
<ControlTemplate x:Key="ObservationsToolTipControlTemplate">
<Border Background="White" BorderBrush="Black" BorderThickness="1" Padding="2" CornerRadius="2" MinWidth="150">
<Border.Effect>
<DropShadowEffect BlurRadius="10" ShadowDepth="0"/>
</Border.Effect>
<Grid>
<Grid.ColumnDefinitions>
<!-- Width="{Binding Source={StaticResource TooltipHeaderColumnWidth}}" MaxWidth="{Binding Source={StaticResource TooltipHeaderColumnWidth}}" -->
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="20"/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
</Grid>
</Border>
</ControlTemplate>
EDIT:
With the setter like the one of Peregrine's answer, I get this rendering:
I wonder why the widths are not equal.
for information, here is the code corresponding to the picture above:
<TextBox Text="{Binding PatientSubStay.Observations, Mode=OneWay}" ToolTip="{Binding}" x:Name="ObservationsTextBox" MaxLength="100">
<TextBox.Style>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="Background" Value="{StaticResource FocusedItemSolidColorBrush}"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
<TextBox.Resources>
<Style TargetType="ToolTip">
<Setter Property="Template" Value="{StaticResource ObservationsToolTipControlTemplate}"/>
<Setter Property="Width" Value="{Binding PlacementTarget.ActualWidth, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Placement" Value="Bottom"/>
</Style>
</TextBox.Resources>
</TextBox>
The issue is that Tooltips exist outside of the standard visual tree, and so can't reference another control by name or as a typed ancestor. The only thing that a tooltip knows about is its PlacementTarget - the control that it is tied to.
The following code demonstates how to bind to a property of the PlacementTarget
<TextBox Text="Some text for the text box" ToolTip="tool tip">
<TextBox.Resources>
<Style TargetType="{x:Type ToolTip}">
<Setter Property="Width" Value="{Binding PlacementTarget.ActualWidth, RelativeSource={RelativeSource Self}}"/>
</Style>
</TextBox.Resources>
</TextBox>
Note that you should use ActualWidth rather than Width to get the size of another control as Width may not actually be set to a value.
Try setting the ActualWidth of TextBox to the Tooltip. When you don't set the Width (
or Width=Auto) the value is double.NaN. The below code worked for me.
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TextBox}}, Path=ActualWidth}"/>
I'm trying to create a WPF window that has a single control and 2 buttons displayed.
The control can be either a TextBox, ComboBox or Slider dependent on the type of object selected to launch this window.
Is it possible to do this or will I have to create a window with 3 conrtols and manipulate their position at runtime?
Regards
Tony
additions to original question
My implementation is as follows
<Window.Resources>
<Style TargetType="TextBox" x:Key="TextBoxTemplate">
<Setter Value="{Binding ElementName=MyWindow, Path=m_csValue}" />
</Style>
<Style TargetType="{x:Type ComboBox}" x:Key="ComboBoxTemplate">
<Setter Value="{Binding ElementName=MyWindow, Path=ItemsForSelection}" />
</Style>
<Style TargetType="{x:Type Slider}" x:Key="SliderTemplate">
<Setter Value="{Binding ElementName=MyWindow, Path=SliderDetail}" />
</Style>
<Style TargetType="{x:Type ContentControl}" x:Key="DisplayValues">
<!-- Default Template -->
<Setter Property="ContentTemplate" Value="{StaticResource TextBoxTemplate}" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=MyWindow, Path=eType}" Value="{x:Static local:eTagDisplay.Text}">
<Setter Property="ContentTemplate">
<Setter.Value>
<ControlTemplate Template="{StaticResource TextBoxTemplate}" />
</Setter.Value>
</Setter>
</DataTrigger>
<!-- DataTrigger Binding="{Binding ElementName=MyWindow, Path=eType}" Value="{x:Static local:eTagDisplay.Combo}">
<Setter Property="ContentTemplate">
<Setter.Value>
<ControlTemplate Template="{StaticResource ComboBoxTemplate}" />
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=MyWindow, Path=eType}" Value="{x:Static local:eTagDisplay.Slider}">
<Setter Property="ContentTemplate">
<Setter.Value>
<ControlTemplate Template="{StaticResource SliderTemplate}" />
</Setter.Value>
</Setter>
</DataTrigger -->
</Style.Triggers>
</Style>
</Window.Resources>
<Grid Width="267">
<StackPanel Name="TagEditor1">
<!-- Text="{Binding ElementName=MyWindow, Path=m_csValue}" / -->
<ContentControl Style="{StaticResource DisplayValues}" />
</StackPanel>
<Button Content="OK" Height="23" HorizontalAlignment="Left" Margin="12,154,0,0" Name="btnOK" VerticalAlignment="Top" Width="75" Click="OnClkOK" />
<Button Content="Cancel" Height="23" HorizontalAlignment="Left" Margin="180,154,0,0" Name="btnCancel" VerticalAlignment="Top" Width="75" Click="OnClkCancel" IsCancel="True" />
</Grid>
I'm getting an error 'System.Windows.Style' is not a valid value for the 'System.Windows.Controls.ContentControl.ContentTemplate' property on a setter. I don't know why this is happening.
My Binding is OK, i believe, as it picks up string OK....
I would do this with a <ContentControl> that has a different <ContentTemplate> depending on what type of control is needed.
You didn't specify how the control type is being passed to the window, so your DataTrigger bindings would probably look a bit different from mine, but this should give you the right idea:
<DataTemplate TargetType="{x:Type ContentControl}" x:Key="TextBoxTemplate">
<TextBox ... />
</DataTemplate>
<DataTemplate TargetType="{x:Type ContentControl}" x:Key="ComboBoxTemplate">
<ComboBox ... />
</DataTemplate>
<DataTemplate TargetType="{x:Type ContentControl}" x:Key="SliderTemplate">
<Slider ... />
</DataTemplate>
<Style x:Key="MyStyle" TargetType="{x:Type ContentControl}">
<!-- Default Template -->
<Setter Property="ContentTemplate"
Value="{StaticResource TextBoxTemplate}" />
<Style.Triggers>
<DataTrigger Binding="{Binding SomeBoundValue}" Value="ComboBox">
<Setter Property="ContentTemplate"
Value="{StaticResource ComboBoxTemplate}" />
</DataTrigger>
<DataTrigger Binding="{Binding SomeBoundValue}" Value="Slider">
<Setter Property="ContentTemplate"
Value="{StaticResource SliderTemplate}" />
</DataTrigger>
</Style.Triggers>
</Style>
...
<ContentControl Style="{StaticResource MyStyle}" />
You could also allow users to specify a Content for your UserControl or Window, and simply display it using a ContentPresenter bound to the Content. Something like this:
<UserControl.Template>
<StackPanel>
<ContentPresenter Content="{TemplateBinding Content}" />
<Button ... />
<Button ... />
</StackPanel>
</UserControl.Template>
then you could use it like this:
<local:MyUserControl>
<TextBox ... />
</local:MyUserControl>
<local:MyUserControl>
<ComboBox ... />
</local:MyUserControl>
<local:MyUserControl>
<Slider ... />
</local:MyUserControl>
I think it is possible with single window.By exposing a property that sets visibilty based on some condition.
i.e textbox visibility is set to visibility.visible and combobox,slider visibilty is set to visibility.collpased.similarly if you want to have combobox visible you make that visible and others collapsed.similarly for slider.
example:
public Visibility TextboxVisibility
{
set
{
Visibility visible = value;
Textboxname.Visibility = visible ;
}
}
I hope this answers your question
I have a UserControl subclass that contains a Grid, which in turn contains a couple TextBlocks and a Border (which also contains a TextBlock). See code below.
<UserControl x:Class="ProjectNS.MyUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:my="clr-namespace:ProjectNS"
mc:Ignorable="d"
Height="49" Width="150" BottomResizeLocked="True" TopResizeLocked="True"
MoveLocks="Vertical" Margin="0,-4" Focusable="True">
<my:MyUserControl.Resources>
<Style x:Key="BorderStyle" TargetType="Border">
<Setter Property="Background" Value="Blue"/>
<Setter Property="BorderBrush" Value="Blue"/>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource
AncestorType={x:Type my:GanttBar}}, Path=IsKeyboardFocusWithin}"
Value="True">
<Setter Property="Background" Value="{StaticResource
SelectedGanttBarBackGroundBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource
SelectedGanttBarBorderBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</my:MyUserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
<RowDefinition Height="3*" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Label FontSize="8.5" HorizontalAlignment="Left"
VerticalAlignment="Bottom" Margin="4,0,0,0" Foreground="Green" />
<Border Grid.Row="1" CornerRadius="5" BorderThickness="1.5" Style="
{StaticResource BorderStyle}" FocusVisualStyle="{StaticResource
SelectedBorderStyle}" Focusable="True" >
<Label FontSize="10" HorizontalAlignment="Center" FontWeight="Bold"
VerticalAlignment="Top" Foreground="White" Margin="0,2,0,0" />
</Border>
<Label HorizontalAlignment="Right" FontSize="8.5" Grid.Row="2"
VerticalAlignment="Top" Margin="0,0,4,0" Foreground="Red" />
</Grid>
</my:MyUserControl>
I'm trying to get the color of the embedded Border to change color when my UserControl receives focus, but I can't for the life of me figure out what actually receives focus when I click on the control. I've tried using the GotFocus event for every control, and nothing fires once the program is running.
Use a DataTrigger on the property IsKeyboardFocusWithin. I'm not positive the exact syntax, but it should look something like this:
<Style TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="Red" />
<Style.Triggers>
<!-- Will change Border color when KeyboardFocus inside Border -->
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" Value="Green" />
</Trigger>
<!-- Will change Border color when UserControl contains KeyboardFocus -->
<DataTrigger Binding="{Binding RelativeSource={RelativeSource
AncestorType={x:Type local:MyUserControl}},
Path=IsKeyboardFocusWithin}" Value="True">
<Setter Property="BorderBrush" Value="Blue" />
</DataTrigger>
</Style.Triggers>
</Style>
I have a scenario where I need to hide some content based on whether a radio button is checked or unchecked. For some reason I can't get this to work the way I expect it to. The behavior is the opposite of what I expect. If I adjust my xaml to accomodate the actual behavior that I'm seeing it everything gets hidden.
Essentially what I have is two radio buttons labeled Fixed and Cycle. When Fixed is checked I want the textbox associated with Fixed to have a visible foreground and the textbox associated with Cycle to have a transparent foreground and vice-versa. What I'm seeing is the exact opposite.
Here's my trigger:
<Grid.Resources>
<Style TargetType="TextBox" x:Key="FixedModeStyle">
<Setter Property="Foreground" Value="Transparent" />
<Setter Property="Width" Value="40" />
<Setter Property="Height" Value="20" />
<Setter Property="Margin" Value="10" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked,
ElementName=rbtFixedMode}" Value="True" >
<Setter Property="Foreground"
Value="{DynamicResource My.Fonts.Global.LightForeground}" />
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="TextBox" x:Key="CycleModeStyle">
<Setter Property="Foreground" Value="Transparent" />
<Setter Property="Width" Value="40" />
<Setter Property="Height" Value="20" />
<Setter Property="Margin" Value="10" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked,
ElementName=rbtCycleMode}" Value="True" >
<Setter Property="Foreground"
Value="{DynamicResource My.Fonts.Global.LightForeground}" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Resources>
Here's my radio buttons and associated textboxes:
<RadioButton x:Name="rbtFixedMode" Content="Fixed"
GroupName="AveragingMode"
Foreground="{DynamicResource My.Fonts.Global.LightForeground}"
IsChecked="{Binding AveragingWindowMode,
Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static Processors:AveragingMode.Fixed}}" />
<DockPanel Grid.Row="1" IsEnabled="{Binding IsChecked, ElementName=rbtFixedMode}">
<TextBox x:Name="txtFixedIntervalLength"
Style="{StaticResource FixedModeStyle}" DockPanel.Dock="Left"
Text="{Binding AveragingWindowFixedLength}" />
</DockPanel>
<RadioButton x:Name="rbtCycleMode" Content="Cycle"
GroupName="AveragingMode" Grid.Row="2"
Foreground="{DynamicResource My.Fonts.Global.LightForeground}"
IsChecked="{Binding AveragingWindowMode,
Converter={StaticResource EnumToBooleanConverter},
ConverterParameter={x:Static Processors:AveragingMode.Cycles}}" />
<DockPanel Grid.Row="3" IsEnabled="{Binding IsChecked, ElementName=rbtCycleMode}">
<TextBox x:Name="txtCycleIntervalLength"
Style="{StaticResource CycleModeStyle}" DockPanel.Dock="Left"
Text="{Binding AveragingWindowCycleLength}"/>
<TextBlock x:Name="txbCycles" Text="Cycles" Margin="4,10"
Foreground="{DynamicResource My.Fonts.Global.LightForeground}" />
</DockPanel>
Any ideas?
Just making the text transparent is a bad idea, the user will still be able to edit it while it is transparent. Besides that the code is obfuscated and redundant. Do not create two styles for a TextBox, both containing the same setters; create a base-style and use BasedOn for sub-styles.
Not quite sure where your code goes wrong, i would suggest you clean it up, maybe there is some logical error, also here is a working example:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<Page.Resources>
</Page.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<RadioButton Name="rbCycle" GroupName="g1" Content="Cycle"/>
<RadioButton Name="rbFixed" GroupName="g1" Content="Fixed" Grid.Column="1"/>
<TextBox Grid.Row="1" Text="cycle box">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=rbCycle}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
<TextBox Grid.Row="1" Grid.Column="1" Text="fixed box">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=rbFixed}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
</Grid>
</ScrollViewer>
</Page>
If you're using binding to set the values of your radio buttons, don't use groups. If you're using groups, don't use binding. The two don't play well together.
That may not be the cause of what you're seeing. But I bet it is. And it's certainly interfering with your ability to diagnose the problem, because after you start clicking on buttons their binding doesn't work anymore.