少有人走的路

勇哥的工业自动化技术网站

本站视觉相关教程整理贴子,持续更新

2020年勇哥的机器视觉实验项目清单(大纲)

勇哥的免费视频教程清单

勇哥在B站发布的视频清单

Avalonia学习(三)常用布局面板演示

常用布局面板演示


image.png


MainWindow.axaml


<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="_03_LayoutPanel.MainWindow"
        Title="Layout Panel - 布局面板演示"
        Width="600"
        Height="500">
  <ScrollViewer>
    <StackPanel Spacing="20" Margin="20">

      <TextBlock Text="StackPanel(栈面板)" FontSize="16" FontWeight="Bold"/>
      <Border Background="#E3F2FD" Padding="10" CornerRadius="5">
        <StackPanel Spacing="10">
          <Button Content="按钮 1"/>
          <Button Content="按钮 2"/>
          <Button Content="按钮 3"/>
        </StackPanel>
      </Border>

      <TextBlock Text="WrapPanel(环绕面板)" FontSize="16" FontWeight="Bold"/>
      <Border Background="#E8F5E9" Padding="10" CornerRadius="5">
        <WrapPanel>
          <Button Content="按钮 A" Margin="5"/>
          <Button Content="按钮 B" Margin="5"/>
          <Button Content="按钮 C" Margin="5"/>
          <Button Content="按钮 D" Margin="5"/>
          <Button Content="按钮 E" Margin="5"/>
          <Button Content="按钮 F" Margin="5"/>
        </WrapPanel>
      </Border>

      <TextBlock Text="StackPanel Horizontal(水平栈面板)" FontSize="16" FontWeight="Bold"/>
      <Border Background="#FFF3E0" Padding="10" CornerRadius="5">
        <StackPanel Orientation="Horizontal" Spacing="10">
          <Button Content="左"/>
          <Button Content="中"/>
          <Button Content="右"/>
        </StackPanel>
      </Border>

      <TextBlock Text="DockPanel(停靠面板)" FontSize="16" FontWeight="Bold"/>
      <Border Background="#F3E5F5" Padding="10" CornerRadius="5" Height="120">
        <DockPanel>
          <Border DockPanel.Dock="Top" Background="#9C27B0" Height="30" CornerRadius="3" Margin="0,0,0,5">
            <TextBlock Text="顶部区域" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
          </Border>
          <Border DockPanel.Dock="Bottom" Background="#FF5722" Height="30" CornerRadius="3" Margin="0,5,0,0">
            <TextBlock Text="底部区域" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
          </Border>
          <Border DockPanel.Dock="Left" Background="#2196F3" Width="80" CornerRadius="3" Margin="0,5,5,5">
            <TextBlock Text="左侧" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
          </Border>
          <Border Background="#4CAF50" CornerRadius="3" Margin="0,5,0,5">
            <TextBlock Text="中间区域(自动填充)" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
          </Border>
        </DockPanel>
      </Border>

      <TextBlock Text="Grid(网格布局)" FontSize="16" FontWeight="Bold"/>
      <Border Background="#ECEFF1" Padding="10" CornerRadius="5" Height="150">
        <Grid>
          <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
          </Grid.ColumnDefinitions>
          <Border Grid.Row="0" Grid.Column="0" Background="#F44336" Margin="2" CornerRadius="3">
            <TextBlock Text="(0,0)" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
          </Border>
          <Border Grid.Row="0" Grid.Column="1" Background="#4CAF50" Margin="2" CornerRadius="3">
            <TextBlock Text="(1,0)" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
          </Border>
          <Border Grid.Row="1" Grid.Column="0" Background="#2196F3" Margin="2" CornerRadius="3">
            <TextBlock Text="(0,1)" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
          </Border>
          <Border Grid.Row="1" Grid.Column="1" Background="#FF9800" Margin="2" CornerRadius="3">
            <TextBlock Text="(1,1)" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
          </Border>
        </Grid>
      </Border>

    </StackPanel>
  </ScrollViewer>
</Window>

Avalonia学习(二)按钮与事件

按钮与事件


解决方案:

image.png




MainWindow.axaml

Avalonia学习(一)vs2022配置Avalonia环境

vs2022配置Avalonia环境


(1)安装vs2022

(2)安装插件

image.png

安装Avalonia for Visual Studio扩展


(3)项目模板

Avalonia能用autofac和HandyControl吗



Autofac这样的依赖注入框架还可以继续在Avalonia中使用吗?


可以。 Autofac 完全可以在 Avalonia 中使用。

Avalonia 本身不内置依赖注入,但它基于 .NET,你完全可以像在普通 WPF 或控制台应用中一样使用 

wpf的基础知识点演示

wpf的基础知识点演示:


知识点包括下面这些:

(1)常见的知识点

cs中的:

wpf, CommunityToolkit.Mvvm, Autofac 技术栈下的多页面操作

这一节演示一下wpf, CommunityToolkit.Mvvm, Autofac 技术栈下的多页面操作。



解决方案:

image.png



INavigationService.cs

Wpf, .net8技术栈下使用HandyControl控件库


HandyControl控件库线上说明见:

https://handyorg.github.io/handycontrol/native_controls/


wpf, CommunityToolkit.Mvvm, Autofac, .net8技术栈下的多语言切换

多语言切换。


act103.gif



image.png

wpf中画svg格式(矢量格式)图标

本节虽然说是使用SVG格式,画矢量图标,但是其实我们只是使用了svg转为Geometry的数据画矢量图标。


image.png


wpf(CommunityToolkit.Mv, Autofac 技术)下的菜单和工具栏的使用例子


接下来研究一下菜单和工具栏的使用。

FontAwesome.Sharp包是一个专门为

<< < 1 2 3 4 5 6 7 8 9 10 > >>
«    2026年3月    »
1
2345678
9101112131415
16171819202122
23242526272829
3031
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
搜索
最新留言
文章归档
网站收藏
友情链接

Powered By Z-BlogPHP 1.7.3

Copyright www.skcircle.com Rights Reserved.

鄂ICP备18008319号


站长QQ:496103864 微信:abc496103864