简单的物流项目实战,WPF的MVVM设计模式(五)

开始界面

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Button Grid.Row="0"
                Content="注册"
                Height="60"
                Width="300"
                Name="SignUpButton"
                Click="SignUpButton_Click"
                />
        <Button Grid.Row="1"
                Content="登录"
                Height="60"
                Width="300"
                Name="SignInButton"
                Click="SignInButton_Click"/>
        <!--<Button Grid.Row="2"
                Content="下单"
                Height="60"
                Width="300"
                Name="DownButton"
                Click="DownButton_Click"/>
        <Button Grid.Row="3"
                Content="查看"
                Height="60"
                Width="300"
                Name="ReadButton"
                Click="ReadButton_Click"/>-->
    </Grid>

注册界面

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Ellipse Height="150" Width="150">
            <Ellipse.Fill>
                <ImageBrush ImageSource="F:\5\WMS\WMS\wallhaven-ym7237.png"/>
            </Ellipse.Fill>
        </Ellipse>
        <StackPanel Grid.Row="1">
            <TextBox Name="UserAccount" 
                     Text="{Binding UserAccount}" 
                     Width="350"
                     Height="25"
                     Margin="0 10 0 10"/>
            <TextBox Name="Password" 
                     Text="{Binding Password}" 
                     Width="350"
                     Height="25"
                     Margin="0 10 0 10"/>
            <Button Name="SignUpButton" Command="{Binding InsertCommand}" 
                    Width="100" 
                    Height="30"
                    Content="注册"/>
        </StackPanel>
    </Grid>

登录界面

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Ellipse Height="150" Width="150">
            <Ellipse.Fill>
                <ImageBrush ImageSource="F:\5\WMS\WMS\wallhaven-ym7237.png"/>
            </Ellipse.Fill>
        </Ellipse>
        <StackPanel Grid.Row="1">
            <TextBox Name="UserAccount" 
                     Text="{Binding Username}" 
                     Width="350"
                     Height="25"
                     Margin="0 10 0 10"/>
            <TextBox Name="Password" 
                     Text="{Binding Userpassword}" 
                     Width="350"
                     Height="25"
                     Margin="0 10 0 10"/>
            <Button Name="SignUpButton" Command="{Binding GetCommand}" 
                    Width="100" 
                    Height="30"
                    Content="登录"/>
        </StackPanel>
    </Grid>

下单界面

    <Grid>
        <StackPanel HorizontalAlignment="Center"
                    Width="600">
            <TextBlock Text="省份"/>
            <TextBox Name="TextBoxProvince" 
                     Text="{Binding Province}" 
                     Margin="0 10 0 10"
                     Height="23"/>
            <TextBlock Text="城市"/>
            <TextBox Name="TextBoxCity" 
                     Text="{Binding City}" 
                     Margin="0 10 0 10" 
                     Height="23"/>
            <TextBlock Text=""/>
            <TextBox Name="TextBoxArea" 
                     Text="{Binding Area}" 
                     Margin="0 10 0 10" 
                     Height="23"/>
            <TextBlock Text="街道"/>
            <TextBox Name="TextBoxStreet" 
                     Text="{Binding Street}" 
                     Margin="0 10 0 10" 
                     Height="23"/>
            <TextBlock Text="用户名"/>
            <TextBox Name="TextBoxUserName" 
                     Text="{Binding Username}" 
                     Margin="0 10 0 10" 
                     Height="23"/>
            <TextBlock Text="手机号"/>
            <TextBox Name="TextBoxPhoneNumber" 
                     Text="{Binding Phonenumber}" 
                     Margin="0 10 0 10" 
                     Height="23"/>
            <TextBlock Text="创建时间"/>
            <TextBox Name="TextBoxCteateTime" 
                     Text="{Binding Createtime}" 
                     Margin="0 10 0 10" 
                     Height="23"/>
            <Button Content="保存"
                    Height="25"
                    Command="{Binding CreateExpressCommand}"/>
        </StackPanel>
    </Grid>

查看下单信息

    <Grid>
        <StackPanel>
            <TextBlock Width="600" Height="25" Text="{Binding Province}"/>
            <TextBlock Width="600" Height="25" Text="{Binding City}"/>
            <TextBlock Width="600" Height="25" Text="{Binding Area}"/>
            <TextBlock Width="600" Height="25" Text="{Binding Street}"/>
            <TextBlock Width="600" Height="25" Text="{Binding Username}"/>
            <TextBlock Width="600" Height="25" Text="{Binding Phonenumber}"/>
            <TextBlock Width="600" Height="25" Text="{Binding Createtime}"/>
            <Button Content="读取" Command="{Binding GetExpressCommand}"
                    Width="300"/>
        </StackPanel>
    </Grid>

实际上到这里就已经完了,但是每个页面的后台都有代码,还没有完,嘻嘻嘻

 

 

 

 

 

 

如下效果图

 

每个页面的后面都没有什么代码就一句代码作为Views和Models连接起来,达到了代码上的解耦,由于博主后面部分没有太多的讲解,时间真的太紧了,这两篇博客也是脱了好久,我猜这么菜的技术,应该没有人看吧,哈哈哈。不过没有什么所谓吧,如果觉得有用的话点个推荐吧,谢谢!

转载于:https://www.cnblogs.com/R00R/p/11332261.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值