当前位置:网站首页>C # switch pages through frame and page
C # switch pages through frame and page
2022-07-07 14:12:00 【Peacock Flying Southeast - Shenzhen】
background You need to add licence function We need to make a decision licence page then mainwindow Switch between home page and login page So Need to put Separate pages
Realize the idea stay mainwindow Create a frame And then in the corresponding cs basis licence To determine whether to load the home page
1 stay mainwindow Use in frame
<Grid>
<Frame
Grid.Row="1"
x:Name="frmMain"
Margin="0,0,0,0"
NavigationUIVisibility="Hidden" FontSize="18">
</Frame>
</Grid>
2 establish page Add an existing item choice page For example, added MainHolePage.xaml
3 stay mainwindow Specify the page to display
frmMain.Source = new Uri("View/MainHoldPage.xaml", UriKind.Relative);
ps:
1 Add to page And then I found out keydown Event cannot be triggered It was solved later :
1 stay page Write in :
Loaded="Page_Loaded"
2 Write in the corresponding event :
private void Page_Loaded(object sender, RoutedEventArgs e)
{
var window = Window.GetWindow(this);
window.KeyDown += Page_KeyDown;
}
3 then page Of keydown The event can be triggered
Or in the form of broadcasting But it's more complicated
边栏推荐
- Introduction to sakt method
- Dry goods | summarize the linkage use of those vulnerability tools
- Redis 核心数据结构 & Redis 6 新特性详
- 2022-7-6 Leetcode 977. Square of ordered array
- 一个简单LEGv8处理器的Verilog实现【四】【单周期实现基础知识及模块设计讲解】
- call undefined function openssl_ cipher_ iv_ length
- 请问,redis没有消费消息,都在redis里堆着是怎么回事?用的是cerely 。
- requires php ~7.1 -&gt; your PHP version (7.0.18) does not satisfy that requirement
- 常用数字信号编码之反向不归零码码、曼彻斯特编码、差分曼彻斯特编码
- 【立体匹配论文阅读】【三】INTS
猜你喜欢
Help tenants
AI talent cultivation new ideas, this live broadcast has what you care about
Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou
UML sequence diagram (sequence diagram)
2022-7-7 Leetcode 844.比较含退格的字符串
手把手教会:XML建模
Sliding rail stepping motor commissioning (national ocean vehicle competition) (STM32 master control)
Introduction to sakt method
Leecode3. Longest substring without repeated characters
随机推荐
2022-7-6 beginner redis (I) download, install and run redis under Linux
[untitled]
SAKT方法部分介绍
Social responsibility · value co creation, Zhongguancun network security and Information Industry Alliance dialogue, wechat entrepreneur Haitai Fangyuan, chairman Mr. Jiang Haizhou
566. 重塑矩阵
高等數學---第八章多元函數微分學1
Huawei image address
IP and long integer interchange
Parsing of XML files
IP address home location query full version
高等数学---第八章多元函数微分学1
Learning breakout 2 - about effective learning methods
ES日志报错赏析-Limit of total fields
ndk初学习(一)
Selenium库
2022-7-7 Leetcode 34. Find the first and last positions of elements in a sorted array
Interface automation test - solution of data dependency between interfaces
Realization of search box effect [daily question]
最长上升子序列模型 AcWing 1012. 友好城市
AutoCAD - how to input angle dimensions and CAD diameter symbols greater than 180 degrees?