Exemplo n.º 1
0
 async void Push()
 {
     await m_UIStack.Push("SampleUI", (GeneralViewModel vm) =>
     {
         vm.Command(SampleUIControl.Event.Push, () =>
         {
             Push();
         });
         vm.Command(SampleUIControl.Event.Change, () =>
         {
             m_UIStack.Switch("SampleUI2", new GeneralViewModel());
         });
         vm.Command(SampleUIControl.Event.Enqueue, async() =>
         {
             var test1   = m_UIQueue.Enqueue("SampleUI", new GeneralViewModel());
             var test2VM = new GeneralViewModel();
             test2VM.Set("QueryResult", "QueryResultTest");
             var test2 = m_UIQueue.Query <string>("SampleUI2", test2VM);
             var test3 = m_UIQueue.Enqueue("SampleUI", new GeneralViewModel());
             try
             {
                 await test1;
             }
             catch (Exception ex)
             {
                 Debug.LogError(ex);
                 m_UIQueue.RepairError();
             }
             try
             {
                 var test = await test2;
                 Debug.LogError(test);
             }
             catch (Exception ex)
             {
                 Debug.LogError(ex);
                 m_UIQueue.RepairError();
             }
             try
             {
                 await test3;
             }
             catch (Exception ex)
             {
                 Debug.LogError(ex);
                 m_UIQueue.RepairError();
             }
         });
     });
 }