using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace FWindSoft.Wpf
{
///
/// 基础窗体
///
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;
}
///
/// 每次都加载
///
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)
{
}
}
}