Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.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# 样式导入XAML组件_C#_.net_Wpf_Xaml - Fatal编程技术网

C# 样式导入XAML组件

C# 样式导入XAML组件,c#,.net,wpf,xaml,C#,.net,Wpf,Xaml,我有一个XAML文件,为stackpanel定义了资源。我想做的是在不影响此视图中其他TextBlox的情况下设置TextBox的样式 我的主要观点 <UserControl x:Class="Comsol.STEA.ProjectViewModule.View.ResourceProfileView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://sche

我有一个XAML文件,为stackpanel定义了资源。我想做的是在不影响此视图中其他TextBlox的情况下设置TextBox的样式

我的主要观点

<UserControl x:Class="Comsol.STEA.ProjectViewModule.View.ResourceProfileView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Resources="clr-namespace:Comsol.STEA.Core.Resources;assembly=Core" 
    xmlns:Converters1="clr-namespace:Comsol.STEA.Core.Utilities.Converters;assembly=Core" 
    xmlns:Commands="clr-namespace:Comsol.STEA.ProjectViewModule.Commands" 
    xmlns:ResourceProfileViews="clr-namespace:Comsol.STEA.ProjectViewModule.View.ResourceProfileViews"
    xmlns:Behaviors="clr-namespace:WpfLib.Behaviors;assembly=WpfLib"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Resources.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Converters1:BoolToCollapsedVisibilityConverter x:Key="btcvc"/>
        </ResourceDictionary>
    </UserControl.Resources>
    <StackPanel Background="{DynamicResource SteaBackgroundBrush}"
                FocusManager.FocusedElement="{Binding ElementName=NameBox}">
        <StackPanel.Resources>
            <Style TargetType="{x:Type TextBox}">
                <Setter Property="Width" Value="360"/>
                <Setter Property="MinLines" Value="3"/>
            </Style>
        </StackPanel.Resources>
        <GroupBox Header="{x:Static Resources:Strings.ProfileSettings}">
            <StackPanel>
                <AdornerDecorator Visibility="{Binding Path=AnyAvailableCategories, Converter={StaticResource btcvc}}">
                    <StackPanel>
                        <ResourceProfileViews:DescriptionView/>         
                    </StackPanel>
                </AdornerDecorator>
            </StackPanel>
        </GroupBox>
    </StackPanel>
</UserControl>
描述视图

<StackPanel Orientation="Horizontal">
    <Label Content="{x:Static Resources:Strings.Description}"/>
    <TextBox Text="{Binding Path=Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/>            
</StackPanel>