123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- namespace FWindSoft.Wpf
- {
- /// <summary>
- /// 基础窗体
- /// </summary>
- public class BaseWindow:System.Windows.Window
- {
- private bool m_IsLoadData = false;
- public BaseWindow()
- {
- this.ShowInTaskbar = false;
- this.EveryTimeLoad = true;
- this.Loaded += BaseWindow_Loaded;
- }
- private void BaseWindow_Loaded(object sender, RoutedEventArgs e)
- {
- OnLoad(e);
- }
- public void ResetLoadData()
- {
- this.m_IsLoadData = false;
- }
- /// <summary>
- /// 每次都加载
- /// </summary>
- public bool EveryTimeLoad { get; protected set; }
- protected virtual void OnLoad(RoutedEventArgs e)
- {
- if (EveryTimeLoad || !m_IsLoadData)
- {
- LoadData(StartParameter);
- m_IsLoadData = true;
- }
-
- }
- internal LoadParameter StartParameter { get; set; }
- protected virtual void LoadData(LoadParameter parameter)
- {
- }
- }
- }
|