如何使NoResize WPF窗口大小适合它的内容但宽度足以完全显示标题?

时间:2016-01-15 10:43:53

标签: c# wpf

编辑:我投票自己关闭,因为确实有重复(见评论)。

我制作了窗口,但标题很长,以缩短了省略号。如何判断我希望标题始终完整显示?

<Window x:Class="xpower_wpf.StartupDialogs.AppSelectionWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ui="http://schemas.mycompany.com/fusion"
    Title="{StaticResource MyAppStrDlgSelectApplication}"
    ResizeMode="NoResize"
    SizeToContent="WidthAndHeight">
    <Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <ListView Grid.Row="0" ItemsSource="{Binding Applications}" SelectedItem="{Binding SelectedApplication}" >
        <ListView.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding AppName}"/>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
    <!-- grid row for separator and for buttons -->
</Grid>
</Window>

0 个答案:

没有答案