成品免费网站源码,梧州网站推广费用,分享wordpress优秀主题,Wordpress怎么配自己的专题今天开始继续Avalonia练习。
本节#xff1a;演示实现登录界面
在网上看见一个博客#xff0c;展示Avalonia实现#xff0c;仿照GGTalk#xff0c;我实现了一下#xff0c;感觉是可以的。将测试的数据代码效果写下来。主要是样式使用#xff0c;图片加载方式。
只有前…今天开始继续Avalonia练习。
本节演示实现登录界面
在网上看见一个博客展示Avalonia实现仿照GGTalk我实现了一下感觉是可以的。将测试的数据代码效果写下来。主要是样式使用图片加载方式。
只有前台代码
Window xmlnshttps://github.com/avaloniauixmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:vmusing:LoginAvalonia.ViewModelsxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006mc:Ignorabled d:DesignWidth800 d:DesignHeight450x:ClassLoginAvalonia.Views.MainWindowx:DataTypevm:MainWindowViewModelIcon/Assets/users2.pngWidth430Height340CanResizeFalse WindowStartupLocationCenterScreenTitleLoginAvaloniaDesign.DataContext!-- This only sets the DataContext for the previewer in an IDE,to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) --vm:MainWindowViewModel//Design.DataContextWindow.Styles Style SelectorTextBox.tb1Setter PropertyMargin Value0,-40,0,0/Setter PropertyHeight Value26/Setter PropertyWidth Value250/Setter PropertyWatermark Value账号/Setter PropertyBorderBrush Value#80c0ff//StyleStyle SelectorTextBox.tb2Setter PropertyMargin Value0,35,0,0/Setter PropertyHeight Value26/Setter PropertyWidth Value250/Setter PropertyWatermark Value密码/Setter PropertyBorderBrush Value#80c0ff/Setter PropertyPasswordChar Value*//Style!--######TextBox标签######--Style SelectorImage.img1Setter PropertyMargin Value0,-250,0,0/Setter PropertyWidth Value430//StyleStyle SelectorImage.img2Setter PropertyMargin Value0,-190,0,0/Setter PropertyWidth Value73/Setter PropertyHeight Value73//Style!--######Image标签######--Style SelectorTextBlock.tbk1Setter PropertyMargin Value5,5,0,0/Setter PropertyForeground ValueWhite//StyleStyle SelectorTextBlock.tbk2Setter PropertyMargin Value292,213,0,0/Setter PropertyForeground Value#0c7ab9/Setter PropertyCursor ValueHand//StyleStyle SelectorTextBlock.tbk3Setter PropertyMargin Value275,305,0,0/Setter PropertyForeground Value#696969//Style!--######TextBlock标签######--Style SelectorButton.bt1Setter PropertyMargin Value100,195,0,0/Setter PropertyWidth Value250/Setter PropertyHeight Value40/Setter PropertyBackground Value#407cff/Setter PropertyForeground ValueWhite/Setter PropertyFontSize Value17/Setter PropertyHorizontalContentAlignment ValueCenter/Setter PropertyVerticalContentAlignment ValueCenter//Style!--######Button标签######--Style SelectorCheckBox.cbx1Setter PropertyMargin Value89,105,0,0 /Setter PropertyBorderBrush Value#3c9fc5//StyleStyle SelectorCheckBox.cbx2Setter PropertyMargin Value190,105,0,0/Setter PropertyBorderBrush Value#3c9fc5//Style!--######CheckBox标签######--/Window.StylesStackPanelBorder BackgroundWhiteBorderBrushGrayBorderThickness1Padding0Width430Height340GridImage Classesimg1 Sourceavares://LoginAvalonia/Assets/image_sign.png /ImageImage Classesimg2 Sourceavares://LoginAvalonia/Assets/8.png /TextBlock Classestbk1GGTalk 2020/TextBlockTextBlock Classestbk2注册登录/TextBlockTextBlock Classestbk3企业即时通讯系统/TextBlockTextBox Classestb1/TextBox Classestb2/CheckBox Classescbx2 自动登录/CheckBoxCheckBox Classescbx1 记住密码/CheckBoxButton Classesbt1 登录/Button/Grid/Border/StackPanel
/Window运行效果 使用的图片
1.
2. 3.