Пример #1
0
 public static void LoadPage(Type type, object dat = null)
 {
     if (typeof(UIPage).IsAssignableFrom(type))
     {
         if (CurrentPage != null)
         {
             if (CurrentPage.GetType() == type)
             {
                 CurrentPage.Show(dat);
                 return;
             }
         }
         EventCallBack.ClearEvent();
         AnimationManage.Manage.ReleaseAll();
         if (CurrentPage != null)
         {
             CurrentPage.Dispose();
         }
         var t = Activator.CreateInstance(type) as UIPage;
         CurrentPage = t;
         t.Initial(Root, dat);
         t.ReSize();
         t.Recovery();
         t.ChangeLanguage();
     }
 }
Пример #2
0
    public static void LoadPage <T>(object dat = null) where T : UIPage, new()
    {
        if (CurrentPage is T)
        {
            CurrentPage.Show(dat);
            return;
        }
        EventCallBack.ClearEvent();
        AnimationManage.Manage.ReleaseAll();
        if (CurrentPage != null)
        {
            CurrentPage.Save();
            CurrentPage.Dispose();
        }
        var t = new T();

        t.Initial(Root, dat);
        t.ReSize();
        CurrentPage = t;
        t.ChangeLanguage();
    }