【XAML】附加属性的xmal写法
附加属性的xmal写法
案例一
<Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="23*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="80" /> <RowDefinition Height="*" MinHeight="300"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <TextBlock> <Grid.Row>1</Grid.Row> dfdsfs </TextBlock> </Grid>
效果
案例二
给窗体添加附加属性WindowChrome
<Window x:Class="CTMvvmDemo.MVVM.Views.MainWindowView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:CTMvvmDemo.MVVM.Views" mc:Ignorable="d" WindowStartupLocation="CenterScreen" x:Name="mainview" Title="MainWindowView" Height="850" Width="1200">
<WindowChrome.WindowChrome> <WindowChrome/> </WindowChrome.WindowChrome> <Grid> </Window>
编程是个人爱好