WPF<1>_XAML Basic

Table of Contents 1. Three-tier architecture 2. Expression mode and architectural mode ASP.net is Microsoft’s new generation scripting language, a powerful server-side technology for creating dynamic Web pages. Avalinia is a powerful framework that enables developers to create cross-platform applications using .NET. 1. Three-tier architecture 1. The architectural pattern consisting of presentation layer, logic layer […]

WPF ToggleButton theme switching animation button

WPF ToggleButton theme switching animation button I imitate an effect in HTML that I saw recently. The general idea is like this in the article. I feel that it can be further refined. code show as below XAML: <UserControl x:Class=”WPFSwitch.AnimationSwitch” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ xmlns:icon=”http://metro.mahapps.com/winfx/xaml/iconpacks” xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″ xmlns:local=”clr-namespace:WPFSwitch” mc:Ignorable=”d” x:Name=”root” ClipToBounds=”True” d:DesignHeight=”200″ d:DesignWidth=”600″> <UserControl.Resources> <local:HalfConverter x:Key=”CornerConverter”/> <local:HalfConverter […]

An in-depth explanation of data binding validation in WPF

In-depth explanation of data binding verification in WPF WPF provides a verification function when the user inputs. Usually verification is implemented in the following two ways: Throws an error in the data object. Usually an exception is thrown during property setting, or the INotifyDataErrorInfo or IDataErrorInfo interface is implemented in the data class. Define validation […]

C# wpf implements more drag functions for any control (including windows)

Directory of series articles Chapter 1 Dragging controls within Grid Chapter 2 Dragging controls within Canvas Chapter 3 Dragging any control Chapter 4 Window Dragging Chapter 5 Additional attributes enable arbitrary dragging Chapter 6 Expand more dragging functions (this chapter) Article directory Table of Contents of Series Articles Preface 1. Added functions 1. MoveTo of […]

[WPF Series] – XAML syntax specification

[WPF Series]-XAML syntax specification Article directory [WPF Series] – XAML syntax specification I. Overview 2. Object element syntax 3. Characteristic syntax (attributes) 4. Processing of characteristic values 5. Enumerated characteristic values 6. Attribute and event member name references 7. Attribute element syntax 8. Set Grammar 9. XAML content attributes XAML content attribute values must be […]

WPF-set button arrangement

Use view model and data binding to implement the function of displaying buttons by category. Below is a simple example that demonstrates how to display different buttons by category on button click in WPF. First, you need a view model that contains the button data and the currently selected category. Use an MVVM framework such […]

A quick example of using Blazor with WPF

Next we will explain how to use Blazor in WPF and use Blazor to do some file editing operations. Here are the things you need to use WPF Blazor Masa Blazor Monaco Install Masa Blazor template Use the CMD command to install the template dotnet new install MASA.Template New Masa Blazor WPF App Find the […]

WPF Material Design UI framework: simple use of some common controls

Article directory Preface related resources MD framework usage Start environment configuration Install Nuget package Test whether the import is successful MD component usage test Button Card ComboBoxes: single box data binding version Data Grids: tables Dialogs: Pop-up windows Simple explanation Drawer: sidebar Tabs Pickers: time picker Progress Indicators: Progress bar Foreword Material Design in xaml […]

wpf implements snake game

Everyone has played the Snake game, and its gameplay is also very simple: use the game buttons to control the direction of the snake up, down, left, and right, and look for something to eat. You will get certain points for each bite you take, and the snake’s body will grow longer as it eats. […]