WPF 實現抽屜菜單

?分享一個WPF 實現抽屜菜單

抽屜菜單

作者:WPFDevelopersOrg

原文鏈接:https://github.com/WPFDevelopersOrg/WPFDevelopers

  • 框架使用大于等于.NET40

  • Visual Studio 2022;

  • 項目使用 MIT 開源許可協議;

  • 更多效果可以通過GitHub[1]|碼云[2]下載代碼;

  • 由于在WPF中沒有現成的類似UWP的抽屜菜單,所以我們自己實現一個。

1) DrawerMenu.cs 代碼如下。

using?System.Collections.Generic;
using?System.Windows;
using?System.Windows.Controls;
using?System.Windows.Media;namespace?WPFDevelopers.Controls
{public?class?DrawerMenu?:?ContentControl{public?new?static?readonly?DependencyProperty?ContentProperty?=DependencyProperty.Register("Content",?typeof(List<DrawerMenuItem>),?typeof(DrawerMenu),new?FrameworkPropertyMetadata(null));public?static?readonly?DependencyProperty?IsOpenProperty?=DependencyProperty.Register("IsOpen",?typeof(bool),?typeof(DrawerMenu),?new?PropertyMetadata(true));public?static?readonly?DependencyProperty?MenuIconColorProperty?=DependencyProperty.Register("MenuIconColor",?typeof(Brush),?typeof(DrawerMenu),new?PropertyMetadata(Brushes.White));public?static?readonly?DependencyProperty?SelectionIndicatorColorProperty?=DependencyProperty.Register("SelectionIndicatorColor",?typeof(Brush),?typeof(DrawerMenu),new?PropertyMetadata(DrawingContextHelper.Brush));public?static?readonly?DependencyProperty?MenuItemForegroundProperty?=DependencyProperty.Register("MenuItemForeground",?typeof(Brush),?typeof(DrawerMenu),new?PropertyMetadata(Brushes.Transparent));static?DrawerMenu(){DefaultStyleKeyProperty.OverrideMetadata(typeof(DrawerMenu),new?FrameworkPropertyMetadata(typeof(DrawerMenu)));}public?new?List<DrawerMenuItem>?Content{get?=>?(List<DrawerMenuItem>)GetValue(ContentProperty);set?=>?SetValue(ContentProperty,?value);}public?bool?IsOpen{get?=>?(bool)GetValue(IsOpenProperty);set?=>?SetValue(IsOpenProperty,?value);}public?Brush?MenuIconColor{get?=>?(Brush)GetValue(MenuIconColorProperty);set?=>?SetValue(MenuIconColorProperty,?value);}public?Brush?SelectionIndicatorColor{get?=>?(Brush)GetValue(SelectionIndicatorColorProperty);set?=>?SetValue(SelectionIndicatorColorProperty,?value);}public?Brush?MenuItemForeground{get?=>?(Brush)GetValue(MenuItemForegroundProperty);set?=>?SetValue(MenuItemForegroundProperty,?value);}public?override?void?BeginInit(){Content?=?new?List<DrawerMenuItem>();base.BeginInit();}}
}

2) DrawerMenuItem.cs 代碼如下。

using?System.Windows;
using?System.Windows.Controls;
using?System.Windows.Input;
using?System.Windows.Media;namespace?WPFDevelopers.Controls
{public?class?DrawerMenuItem?:?ListBoxItem{public?static?readonly?DependencyProperty?TextProperty?=DependencyProperty.Register("Text",?typeof(string),?typeof(DrawerMenuItem),new?PropertyMetadata(string.Empty));public?static?readonly?DependencyProperty?IconProperty?=DependencyProperty.Register("Icon",?typeof(ImageSource),?typeof(DrawerMenuItem),new?PropertyMetadata(null));public?static?readonly?DependencyProperty?SelectionIndicatorColorProperty?=DependencyProperty.Register("SelectionIndicatorColor",?typeof(Brush),?typeof(DrawerMenuItem),new?PropertyMetadata(DrawingContextHelper.Brush));public?static?readonly?DependencyProperty?SelectionCommandProperty?=DependencyProperty.Register("SelectionCommand",?typeof(ICommand),?typeof(DrawerMenuItem),new?PropertyMetadata(null));static?DrawerMenuItem(){DefaultStyleKeyProperty.OverrideMetadata(typeof(DrawerMenuItem),new?FrameworkPropertyMetadata(typeof(DrawerMenuItem)));}public?string?Text{get?=>?(string)GetValue(TextProperty);set?=>?SetValue(TextProperty,?value);}public?ImageSource?Icon{get?=>?(ImageSource)GetValue(IconProperty);set?=>?SetValue(IconProperty,?value);}public?Brush?SelectionIndicatorColor{get?=>?(Brush)GetValue(SelectionIndicatorColorProperty);set?=>?SetValue(SelectionIndicatorColorProperty,?value);}public?ICommand?SelectionCommand{get?=>?(ICommand)GetValue(SelectionCommandProperty);set?=>?SetValue(SelectionCommandProperty,?value);}}
}

3) DrawerMenu.xaml 代碼如下。

<ResourceDictionary?xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"xmlns:controls="clr-namespace:WPFDevelopers.Controls"><ResourceDictionary.MergedDictionaries><ResourceDictionary?Source="Basic/ControlBasic.xaml"/></ResourceDictionary.MergedDictionaries><Style?x:Key="DrawerMenuToggleButton"?TargetType="ToggleButton"?BasedOn="{StaticResource?ControlBasicStyle}"><Setter?Property="IsChecked"?Value="False"/><Setter?Property="Template"><Setter.Value><ControlTemplate?TargetType="{x:Type?ToggleButton}"><Grid?Background="{TemplateBinding?Background}"><ContentPresenter?HorizontalAlignment="Center"?VerticalAlignment="Center"?/></Grid></ControlTemplate></Setter.Value></Setter><Style.Triggers><Trigger?Property="IsMouseOver"?Value="True"><Setter?Property="Opacity"?Value="0.8"?/><Setter?Property="Cursor"?Value="Hand"?/><Setter?Property="Template"><Setter.Value><ControlTemplate?TargetType="{x:Type?ToggleButton}"><BorderBackground="{TemplateBinding?Background}"BorderBrush="Black"BorderThickness="1"><ContentPresenter?HorizontalAlignment="Center"?VerticalAlignment="Center"?/></Border></ControlTemplate></Setter.Value></Setter></Trigger></Style.Triggers></Style><Style?x:Key="DrawerMenuListBox"?TargetType="ListBox"?BasedOn="{StaticResource?ControlBasicStyle}"><Setter?Property="Background"?Value="Transparent"?/><Setter?Property="BorderBrush"?Value="Transparent"?/><Setter?Property="BorderThickness"?Value="0"/><Setter?Property="Template"><Setter.Value><ControlTemplate><ScrollViewer><ItemsPresenter?Margin="0"?/></ScrollViewer></ControlTemplate></Setter.Value></Setter></Style><Style?x:Key="ButtonFocusVisual"><Setter?Property="Control.Template"><Setter.Value><ControlTemplate><Border><Rectangle?Margin="2"StrokeThickness="1"Stroke="#60000000"StrokeDashArray="1?2"/></Border></ControlTemplate></Setter.Value></Setter></Style><!--?Fill?Brushes?--><SolidColorBrush?x:Key="NormalBrush"?Color="Transparent"??po:Freeze="True"/><SolidColorBrush?x:Key="DarkBrush"?Color="#ddd"??po:Freeze="True"/><SolidColorBrush?x:Key="PressedBrush"?Color="#80FFFFFF"??po:Freeze="True"/><SolidColorBrush?x:Key="DisabledForegroundBrush"?Color="Transparent"??po:Freeze="True"/><SolidColorBrush?x:Key="DisabledBackgroundBrush"?Color="Transparent"??po:Freeze="True"/><!--?Border?Brushes?--><SolidColorBrush?x:Key="NormalBorderBrush"?Color="Transparent"??po:Freeze="True"/><SolidColorBrush?x:Key="PressedBorderBrush"?Color="Transparent"??po:Freeze="True"/><SolidColorBrush?x:Key="DefaultedBorderBrush"?Color="Transparent"??po:Freeze="True"/><SolidColorBrush?x:Key="DisabledBorderBrush"?Color="Transparent"??po:Freeze="True"/><Style?x:Key="DrawerMenuItemButtonStyle"?TargetType="Button"?BasedOn="{StaticResource?ControlBasicStyle}"><Setter?Property="FocusVisualStyle"?Value="{StaticResource?ButtonFocusVisual}"/><Setter?Property="MinHeight"?Value="23"/><Setter?Property="MinWidth"?Value="75"/><Setter?Property="Cursor"?Value="Hand"?/><Setter?Property="Template"><Setter.Value><ControlTemplate?TargetType="Button"><Border?x:Name="Border"??CornerRadius="0"?BorderThickness="0"Background="Transparent"BorderBrush="Transparent"><ContentPresenter?HorizontalAlignment="Stretch"VerticalAlignment="Stretch"RecognizesAccessKey="True"/></Border><ControlTemplate.Triggers><Trigger?Property="IsKeyboardFocused"?Value="true"><Setter?TargetName="Border"?Property="BorderBrush"?Value="{DynamicResource?DefaultedBorderBrush}"?/></Trigger><Trigger?Property="IsDefaulted"?Value="true"><Setter?TargetName="Border"?Property="BorderBrush"?Value="{DynamicResource?DefaultedBorderBrush}"?/></Trigger><Trigger?Property="IsMouseOver"?Value="true"><Setter?TargetName="Border"?Property="Background"?Value="{DynamicResource?DarkBrush}"?/></Trigger><Trigger?Property="IsPressed"?Value="true"><Setter?TargetName="Border"?Property="Background"?Value="{DynamicResource?PressedBrush}"?/><Setter?TargetName="Border"?Property="BorderBrush"?Value="{DynamicResource?PressedBorderBrush}"?/></Trigger><Trigger?Property="IsEnabled"?Value="false"><Setter?TargetName="Border"?Property="Background"?Value="{DynamicResource?DisabledBackgroundBrush}"?/><Setter?TargetName="Border"?Property="BorderBrush"?Value="{DynamicResource?DisabledBorderBrush}"?/><Setter?Property="Foreground"?Value="{DynamicResource?DisabledForegroundBrush}"/></Trigger></ControlTemplate.Triggers></ControlTemplate></Setter.Value></Setter></Style><Style?TargetType="controls:DrawerMenuItem"><Setter?Property="HorizontalContentAlignment"?Value="Stretch"?/><Setter?Property="Foreground"?Value="{Binding?RelativeSource={RelativeSource?AncestorType={x:Type?controls:DrawerMenu}},?Path=MenuItemForeground}"/><Setter?Property="SelectionIndicatorColor"?Value="{Binding?RelativeSource={RelativeSource?AncestorType={x:Type?controls:DrawerMenu}},?Path=SelectionIndicatorColor}"/><Setter?Property="Template"><Setter.Value><ControlTemplate?TargetType="controls:DrawerMenuItem"><Button?x:Name="PART_Button"?Height="44"Command="{TemplateBinding?SelectionCommand}"?ToolTip="{TemplateBinding?Text}"HorizontalContentAlignment="Stretch"?VerticalContentAlignment="Stretch"Style="{StaticResource?DrawerMenuItemButtonStyle}"><Grid><Grid.ColumnDefinitions><ColumnDefinition?Width="5"/><ColumnDefinition/></Grid.ColumnDefinitions><Grid?Grid.ColumnSpan="2"><Grid?Width="300"><Grid.ColumnDefinitions><ColumnDefinition?Width="45"/><ColumnDefinition/></Grid.ColumnDefinitions><Image?Grid.Column="0"?Source="{TemplateBinding?Icon}"?Margin="10,5,5,5"/><TextBlock?Text="{TemplateBinding?Text}"?Grid.Column="1"Margin="10,0,0,0"?HorizontalAlignment="Left"?VerticalAlignment="Center"?FontSize="{StaticResource?TitleFontSize}"Foreground="{TemplateBinding?Foreground}"TextWrapping="Wrap"/></Grid></Grid><Grid?Name="PART_ItemSelectedIndicator"?Grid.Column="0"?Background="{TemplateBinding?SelectionIndicatorColor}"?Visibility="Collapsed"?/></Grid></Button><ControlTemplate.Triggers><Trigger?Property="IsSelected"?Value="True"><Setter?TargetName="PART_ItemSelectedIndicator"?Property="Visibility"?Value="Visible"?/></Trigger><Trigger?SourceName="PART_Button"?Property="IsPressed"?Value="True"><Trigger.ExitActions><BeginStoryboard><Storyboard><BooleanAnimationUsingKeyFrames?Storyboard.TargetProperty="IsSelected"><DiscreteBooleanKeyFrame?KeyTime="00:00:00"?Value="True"?/></BooleanAnimationUsingKeyFrames></Storyboard></BeginStoryboard></Trigger.ExitActions></Trigger></ControlTemplate.Triggers></ControlTemplate></Setter.Value></Setter></Style><Style?TargetType="controls:DrawerMenu"><Setter?Property="Width"?Value="50"/><Setter?Property="Visibility"?Value="Visible"/><Setter?Property="IsOpen"?Value="True"/><Setter?Property="Template"><Setter.Value><ControlTemplate?TargetType="controls:DrawerMenu"><Grid?Background="{TemplateBinding?Background}"><ToggleButton?HorizontalAlignment="Left"?Background="#333"VerticalAlignment="Top"?Height="40"?Width="50"IsChecked="{Binding?RelativeSource={RelativeSource?AncestorType={x:Type?controls:DrawerMenu}},?Path=IsOpen}"Style="{StaticResource?DrawerMenuToggleButton}"><Path?HorizontalAlignment="Center"?VerticalAlignment="Center"?Stretch="Uniform"?Width="20"?Fill="{TemplateBinding?MenuIconColor}"Data="{StaticResource?PathMenu}"/></ToggleButton><ListBox?ItemsSource="{TemplateBinding?Content}"?HorizontalAlignment="Left"?Margin="0,40,0,0"?VerticalAlignment="Top"?Style="{StaticResource?DrawerMenuListBox}"ScrollViewer.HorizontalScrollBarVisibility="Disabled"?SelectedIndex="0"/></Grid></ControlTemplate></Setter.Value></Setter><Style.Triggers><Trigger?Property="IsOpen"?Value="False"><Trigger.EnterActions><BeginStoryboard><Storyboard><DoubleAnimation?Storyboard.TargetProperty="Width"To="180"Duration="0:0:0.2"/></Storyboard></BeginStoryboard></Trigger.EnterActions><Trigger.ExitActions><BeginStoryboard><Storyboard><DoubleAnimation?Storyboard.TargetProperty="Width"To="50"Duration="0:0:0.2"/></Storyboard></BeginStoryboard></Trigger.ExitActions></Trigger></Style.Triggers></Style>
</ResourceDictionary>

4) DrawerMenuExample.xaml 代碼如下。

<UserControl?x:Class="WPFDevelopers.Samples.ExampleViews.DrawerMenu.DrawerMenuExample"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:d="http://schemas.microsoft.com/expression/blend/2008"?xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews.DrawerMenu"xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"mc:Ignorable="d"?d:DesignHeight="450"?d:DesignWidth="800"><Grid?Background="#FF7B7BFF"><Grid.ColumnDefinitions><ColumnDefinition??Width="Auto"/><ColumnDefinition/></Grid.ColumnDefinitions><wpfdev:DrawerMenu?Background="#eee"SelectionIndicatorColor="{StaticResource?PrimaryPressedSolidColorBrush}"?MenuItemForeground="{StaticResource?BlackSolidColorBrush}"?HorizontalAlignment="Left"><wpfdev:DrawerMenu.Content><wpfdev:DrawerMenuItem?Icon="pack://application:,,,/Images/CircularMenu/2.png"?Text="主頁"SelectionCommand="{Binding?HomeCommand,RelativeSource={RelativeSource?AncestorType=local:DrawerMenuExample}}"/><wpfdev:DrawerMenuItem?Icon="pack://application:,,,/Images/CircularMenu/4.png"?Text="Edge"SelectionCommand="{Binding?EdgeCommand,RelativeSource={RelativeSource?AncestorType=local:DrawerMenuExample}}"/><wpfdev:DrawerMenuItem?Icon="pack://application:,,,/Images/CircularMenu/1.png"?Text="云盤"SelectionCommand="{Binding?CloudCommand,RelativeSource={RelativeSource?AncestorType=local:DrawerMenuExample}}"/><wpfdev:DrawerMenuItem?Icon="pack://application:,,,/Images/CircularMenu/8.png"?Text="郵件"SelectionCommand="{Binding?MailCommand,RelativeSource={RelativeSource?AncestorType=local:DrawerMenuExample}}"/><wpfdev:DrawerMenuItem?Icon="pack://application:,,,/Images/CircularMenu/6.png"?Text="視頻"SelectionCommand="{Binding?VideoCommand,RelativeSource={RelativeSource?AncestorType=local:DrawerMenuExample}}"/></wpfdev:DrawerMenu.Content></wpfdev:DrawerMenu><Frame?Name="myFrame"?Grid.Column="1"?Margin="0,40,0,0"NavigationUIVisibility="Hidden"></Frame></Grid>
</UserControl>

5) DrawerMenuExample.xaml.cs 代碼如下。

using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Windows;
using?System.Windows.Controls;
using?System.Windows.Input;
using?System.Windows.Media;
using?WPFDevelopers.Samples.Helpers;namespace?WPFDevelopers.Samples.ExampleViews.DrawerMenu
{///?<summary>///?Win10MenuExample.xaml?的交互邏輯///?</summary>public?partial?class?DrawerMenuExample?:?UserControl{private?List<Uri>?_uriList?=?new?List<Uri>(){new?Uri("ExampleViews/DrawerMenu/HomePage.xaml",UriKind.Relative),new?Uri("ExampleViews/DrawerMenu/EdgePage.xaml",UriKind.Relative),};public?DrawerMenuExample(){InitializeComponent();myFrame.Navigate(_uriList[0]);}public?ICommand?HomeCommand?=>?new?RelayCommand(obj?=>{myFrame.Navigate(_uriList[0]);});public?ICommand?EdgeCommand?=>?new?RelayCommand(obj?=>{myFrame.Navigate(_uriList[1]);});public?ICommand?CloudCommand?=>?new?RelayCommand(obj?=>{WPFDevelopers.Minimal.Controls.MessageBox.Show("點擊了云盤","提示");});public?ICommand?MailCommand?=>?new?RelayCommand(obj?=>{WPFDevelopers.Minimal.Controls.MessageBox.Show("點擊了郵件","提示");});public?ICommand?VideoCommand?=>?new?RelayCommand(obj?=>{WPFDevelopers.Minimal.Controls.MessageBox.Show("點擊了視頻","提示");});}
}

6) HomePage.xaml.cs 代碼如下。

<Page?x:Class="WPFDevelopers.Samples.ExampleViews.DrawerMenu.HomePage"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:d="http://schemas.microsoft.com/expression/blend/2008"?xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews.DrawerMenu"mc:Ignorable="d"?d:DesignHeight="450"?d:DesignWidth="800"Title="HomePage"?Background="{StaticResource?PrimaryTextSolidColorBrush}"><Grid><TextBlock?VerticalAlignment="Center"HorizontalAlignment="Center"Width="400"?TextAlignment="Center"TextWrapping="Wrap"Margin="0,0,0,40"FontSize="{StaticResource?NormalFontSize}"><Run?Foreground="White">Home</Run><Run?Text="微信公眾號?WPFDevelopers"?FontSize="40"Foreground="#A9CC32"?FontWeight="Bold"></Run><LineBreak/><Hyperlink?NavigateUri="https://github.com/WPFDevelopersOrg/WPFDevelopers.git"RequestNavigate="GithubHyperlink_RequestNavigate">?Github?源代碼</Hyperlink><Run/><Run/><Run/><Hyperlink?NavigateUri="https://gitee.com/yanjinhua/WPFDevelopers.git"RequestNavigate="GiteeHyperlink_RequestNavigate">?碼云源代碼</Hyperlink></TextBlock></Grid>
</Page>

7) EdgePage.xaml.cs 代碼如下。

<Page?x:Class="WPFDevelopers.Samples.ExampleViews.DrawerMenu.EdgePage"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:d="http://schemas.microsoft.com/expression/blend/2008"?xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews.DrawerMenu"mc:Ignorable="d"?d:DesignHeight="450"?d:DesignWidth="800"Title="EdgePage"??Background="{DynamicResource?PrimaryPressedSolidColorBrush}"><Grid><StackPanel?VerticalAlignment="Center"Margin="0,0,0,40"><Image?Source="pack://application:,,,/Images/CircularMenu/4.png"?Stretch="Uniform"Width="50"/><TextBlock?VerticalAlignment="Center"HorizontalAlignment="Center"TextAlignment="Center"Foreground="White"Text="即將跳轉至Edge瀏覽器"FontSize="{StaticResource?TitleFontSize}"Padding="0,10"></TextBlock></StackPanel></Grid>
</Page>

參考①[3]參考②[4]

參考資料

[1]

GitHub: https://github.com/WPFDevelopersOrg/WPFDevelopers

[2]

碼云: https://github.com/WPFDevelopersOrg/WPFDevelopers

[3]

參考①: https://github.com/WPFDevelopersOrg/WPFDevelopers/tree/master/src/WPFDevelopers/Controls/DrawerMenu

[4]

參考②: https://gitee.com/WPFDevelopersOrg/WPFDevelopers/tree/master/src/WPFDevelopers/Controls/DrawerMenu

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/284650.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/284650.shtml
英文地址,請注明出處:http://en.pswp.cn/news/284650.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

selenium 定制啟動 chrome 的選項

2019獨角獸企業重金招聘Python工程師標準>>> selenium 定制啟動 chrome 的選項 博客分類&#xff1a; java 搜索引擎&#xff0c;爬蟲 使用 selenium 時&#xff0c;我們可能需要對 chrome 做一些特殊的設置&#xff0c;以完成我們期望的瀏覽器行為&#xff0c;比如…

平臺級 SAAS 架構的基礎:統一身份管理系統

業內在用戶統一身份認證及授權管理領域&#xff0c;主要關注 4 個方面&#xff1a;集中賬號管理&#xff08;Account&#xff09;、集中認證管理&#xff08;Authentication&#xff09;、集中授權管理&#xff08;Authorization&#xff09;和集中審計管理&#xff08;Audit&a…

【ArcGIS Pro微課1000例】0017:ArcGIS Pro 2.8制作炫酷的ETOPO1全球DEM地圖

ArcGIS Pro相對于ArcGIS,在制圖方面做了很大的提升,做出的地圖更加優美,本文講解基于NOAA的ETOPO1數據全球DEM數據制作炫酷的全球DEM地圖,先看效果再教學! 1. 效果展示 全球 澳大利亞大陸

Js中的for in

2019獨角獸企業重金招聘Python工程師標準>>> 后臺數據&#xff1a; List<Map<String, Object>> uTags query.selectAllList("velocity.userGetTags", map); 前端解析&#xff1a; for(var i in data.content){//由于這里是List[i](Map).IDc…

VMWare 安裝 Linux

參考 &#xff1a; http://www.aboutyun.com/thread-6780-1-1.html 這的是很詳細。贊一下 我這里就簡化一下。 1 下載&#xff1a; VMWare : https://download3.vmware.com/software/wkst/file/VMware-workstation-full-10.0.0-1295980.exe ubuntu : http://www.aboutyun…

【ArcGIS Pro微課1000例】0018:ArcGIS Pro 2.8通過OLE DB與個人數據庫建立連接案例

對于個人數據庫,Access程序可以直接打開。本文講解在ArcGIS Pro2.8中通過OLE DB與個人數據庫MDB建立聯系的方法與過程。 文章目錄 1. 個人數據庫準備2. OLE DB連接個人數據庫1. 個人數據庫準備 準備一個個人數據庫,在上面右鍵→復制文件地址。 文件地址為:"C:\test.md…

JAVA生成并導出json文件

將一個list集合轉換成json文件并導出&#xff1a; 數據集合&#xff1a;    List<Object> agencyList new ArrayList<Object>();Map<String, Object> agencyMap new HashMap<>();agencyMap.put("agencyName",agencyName);agencyMap.pu…

《ASP.NET Core 6框架揭秘》實例演示[02]:基于路由、MVC和gRPC的應用開發

ASP.NET Core可以視為一種底層框架&#xff0c;它為我們構建出了基于管道的請求處理模型&#xff0c;這個管道由一個服務器和多個中間件構成&#xff0c;而與路由相關的EndpointRoutingMiddleware和EndpointMiddleware是兩個最為重要的中間件。MVC和gRPC開發框架就建立在路由基…

什么是 JWT -- JSON WEB TOKEN

什么是JWT Json web token (JWT), 是為了在網絡應用環境間傳遞聲明而執行的一種基于JSON的開放標準&#xff08;(RFC 7519).該token被設計為緊湊且安全的&#xff0c;特別適用于分布式站點的單點登錄&#xff08;SSO&#xff09;場景。JWT的聲明一般被用來在身份提供者和服務提…

Re-installation failed due to different application signatures.

問題&#xff1a; 在虛擬設備上運行程序時提示安裝失敗。 [2010-08-08 00:38:30 - myApp] Re-installation failed due to different application signatures. [2010-08-08 00:38:30 - myApp] You must perform a full uninstall of the application. WARNING: This will remo…

【ArcGIS微課1000例】0024:ArcGIS如何連接文件夾、設認工作目錄、默認地理數據庫、相對路徑與絕對路徑?

ArcGIS軟件在初次安裝完成或者為了工作的方便,通常需要連接到指定的文件夾、設置默認工作路徑,默認地理數據庫、相對路徑與絕對路徑等。 文章目錄 1. 文件夾連接2. 默認工作目錄3. 默認地理數據庫4. 相對路徑與絕對路徑1. 文件夾連接 在初次安裝完ArcGIS時,默認沒有文件夾連…

shell 用環境變量的值修改properties文件

假設有如下屬性文件 demo.properties user.nametest user.password123456 ............................... 需求&#xff1a;先需要通過shell 腳本將 user.name 和 user.password 的value值替換為實際需要的用戶名和密碼&#xff0c; 將可以通過如下方式實現&#xff1a; sed …

【Spring Cloud】Redis緩存接入監控、運維平臺CacheCloud

CacheCloud CacheCloud提供一個Redis云管理平臺&#xff1a;實現多種類型(Redis Standalone、Redis Sentinel、Redis Cluster)自動部署、解決Redis實例碎片化現象、提供完善統計、監控、運維功能、減少運維成本和誤操作&#xff0c;提高機器的利用率&#xff0c;提供靈活的伸縮…

[Win10應用開發] 使用 Windows 推送服務 (WNS)

前言 Windows 推送服務&#xff08;WNS&#xff09;也是 Win10 通知機制中的一種&#xff0c;今天與大家一起學習一下有關WNS的相關知識。使用 Windows 推送服務的前提是你需要有一個微軟開發者賬號&#xff0c;這樣才能得到一些合法的密鑰信息用于與WNS服務器完成通訊操作。 …

Windows 11 新版 25158 推送!全新搜索框和圖標、小組件動態內容和通知標記

面向 Dev 頻道的 Windows 預覽體驗成員&#xff0c;微軟現已推送 Windows 11 預覽版 Build 25158。主要變化1.微軟宣布為 Windows 11 搜索引入全新視覺體驗&#xff0c;由搜索框或重新設計的搜索圖標呈現。目前該功能僅向部分 Windows 預覽體驗成員推出&#xff0c;將在未來向所…

Python之路【第一篇】:環境搭建

虛擬機安裝 下載VMwareWorkstation以及centos,安裝完VMwareWorkstation&#xff0c;創建一個虛擬機&#xff0c;然后在新創建的虛擬機上運行centos linux環境搭建 公司開發使用linux的原因&#xff1a;穩定、安全、開源 在虛擬機中使用centos這個版本&#xff0c;作為服務器端的…

【BIM入門實戰】Revit創建地形的幾種方法及優缺點

Revit在體量和場地選項卡的【地形表面】工具可以創建三維地形,有三種方法:放置點、指定點文件和導入實例文件、傾斜攝影點云技術和InfraWorks地形生成。 文章目錄 1. 放置點2. 指定點文件3. 導入實例文件4. 傾斜攝影點云技術5. InfraWorks地形生成1. 放置點 放置點功能位于體…

2024年起重機司機(限門式起重機)證考試題庫及起重機司機(限門式起重機)試題解析

題庫來源&#xff1a;安全生產模擬考試一點通公眾號小程序 2024年起重機司機(限門式起重機)證考試題庫及起重機司機(限門式起重機)試題解析是安全生產模擬考試一點通結合&#xff08;安監局&#xff09;特種作業人員操作證考試大綱和&#xff08;質檢局&#xff09;特種設備作…

微服務架構下的統一身份認證和授權

一、預備知識 本文討論基于微服務架構下的身份認證和用戶授權的技術方案&#xff0c;在閱讀之前&#xff0c;最好先熟悉并理解以下幾個知識點&#xff1a; 微服務架構相關概念&#xff1a;服務注冊、服務發現、API 網關身份認證和用戶授權&#xff1a;SSO、CAS、OAuth2.0、JW…

使用vh來制作高度自適應頁面和元素垂直居中

為什么80%的碼農都做不了架構師&#xff1f;>>> vh單位 vh是CSS3中的一個長度單位&#xff0c;其值為&#xff1a;100vh 視窗高度。即如果窗口高度為500px&#xff0c;那么 1vh 5px。具體的值會隨著瀏覽器視窗高度的改變而實時改變&#xff0c;因此可以利用這個單…