当前位置:网站首页>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
边栏推荐
- c#通过frame 和 page 切换页面
- XML文件的解析操作
- Vmware共享主机的有线网络IP地址
- Common response status codes
- gvim【三】【_vimrc配置】
- "Song of ice and fire" in the eleventh issue of "open source Roundtable" -- how to balance the natural contradiction between open source and security?
- 一个简单LEGv8处理器的Verilog实现【四】【单周期实现基础知识及模块设计讲解】
- Realization of search box effect [daily question]
- How to check the ram and ROM usage of MCU through Keil
- 【日常训练】648. 单词替换
猜你喜欢
Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
"Song of ice and fire" in the eleventh issue of "open source Roundtable" -- how to balance the natural contradiction between open source and security?
为租客提供帮助
Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
XML文件的解析操作
带你掌握三层架构(建议收藏)
566. 重塑矩阵
AI人才培育新思路,这场直播有你关心的
Redis can only cache? Too out!
Mathématiques avancées - - chapitre 8 différenciation des fonctions multivariables 1
随机推荐
Laravel5 call to undefined function OpenSSL cipher IV length() error php7 failed to open OpenSSL extension
Is the spare money in your hand better to fry stocks or buy financial products?
高等數學---第八章多元函數微分學1
数据库系统概论-第一章绪论【概念模型、层次模型和三级模式(外模式、模式、内模式)】
Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
FCOS3D label assignment
mysql导入文件出现Data truncated for column ‘xxx’ at row 1的原因
2022-7-6 Leetcode27. Remove the element - I haven't done the problem for a long time. It's such an embarrassing day for double pointers
Regular expression integer positive integer some basic expressions
Interface automation test - solution of data dependency between interfaces
VSCode 配置使用 PyLint 语法检查器
AI人才培育新思路,这场直播有你关心的
2022-7-6 初学redis(一)在 Linux 下下载安装并运行 redis
The meaning of variables starting with underscores in PHP
数据流图,数据字典
现在网上开户安全么?那么网上开户选哪个证券公司?
内存溢出和内存泄漏的区别
Hands on Teaching: XML modeling
gvim【三】【_vimrc配置】
2022-7-7 Leetcode 844.比较含退格的字符串