在我们学习MVVM框架的时候肯定少不了绑定各种数据,我写了一个简单的ComboBox下拉框的绑定数据的代码:
首先是View视图部分:
<Window x:Class="xia.MainWindow"
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:xia"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center"