Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在行为中使用静态资源_C#_Wpf - Fatal编程技术网

C# 在行为中使用静态资源

C# 在行为中使用静态资源,c#,wpf,C#,Wpf,我有一个文本框,并添加了一个行为: <TextBox VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Grid.Row="0" Grid.Column="1" FontSize="22" > <Binding Path="IpAddr" ValidatesOnNotifyDataErrors="True">

我有一个
文本框
,并添加了一个行为:

<TextBox VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Grid.Row="0" Grid.Column="1"
                 FontSize="22" >
            <Binding Path="IpAddr" ValidatesOnNotifyDataErrors="True">
                <Binding.ValidationRules>
                    <local:IpAddressRule />
                </Binding.ValidationRules>
            </Binding>
            <i:Interaction.Behaviors>
                <behaviors:TextBoxInputMaskBehavior InputMask="{StaticResource InputMaskIp}" PromptChar="0" />
            </i:Interaction.Behaviors>
        </TextBox>
现在我的问题是,如何将资源绑定到:

<i:Interaction.Behaviors>
    //Will bind resources here.
</i:Interaction.Behaviors>

//将在这里绑定资源。

交互。行为
是一个只读的
行为集合
继承自
AttachableCollection
&的集合,您无法对其设置绑定

<i:Interaction.Behaviors>
    //Will bind resources here.
</i:Interaction.Behaviors>