views:

49

answers:

0

I have a binding that when ever I set it and try to reload the design view, Visual Studio crashes. (This is in design view in the IDE, not at runtime.)

I am looking for a work around.

Here is the binding:

<Button HorizontalAlignment="Right" x:Name="btnPick" Grid.Column="3" Style="{StaticResource roundButton}" 
        Width="15" Height="15" Tag="{Binding WorkItemForColumn.Id}" Margin="5,0,10,0"

        <!-- This is the line that causes the issues-->
        Visibility="{Binding LinkModeVisibility, Source={x:Static loc:MainMediator.Instance}}">

</Button>

Here is the relevant code behind:

public bool MoveModeSelected
{
    get { return (bool)GetValue(MoveModeSelectedProperty); }
    set 
    { 
        SetValue(MoveModeSelectedProperty, value);

        // If we are activating Move Mode then hide the link stuff
        if (value)
            LinkModeVisibility = Visibility.Collapsed;
        // If we are going to link mode then show the link stuff
        else
            LinkModeVisibility = Visibility.Visible;
    }
}
public static readonly DependencyProperty MoveModeSelectedProperty = DependencyProperty.Register("MoveModeSelected", typeof(bool), typeof(MainMediator), new UIPropertyMetadata(false));




public Visibility LinkModeVisibility
{
    get { return (Visibility)GetValue(LinkModeVisibilityProperty); }
    set { SetValue(LinkModeVisibilityProperty, value); }
}
public static readonly DependencyProperty LinkModeVisibilityProperty = DependencyProperty.Register("LinkModeVisibility", typeof(Visibility), typeof(MainMediator), new UIPropertyMetadata(Visibility.Visible));

Any workarounds to this issue would be appreciated.