Exemple #1
0
 private void BtAdd_Click(object sender, RoutedEventArgs e)
 {
     if (TxtTask.Text != "")
     {
         CustomItemList item = new CustomItemList(TxtTask.Text)
         {
             IsEnabled = false
         };
         ListTask.Items.Add(item);
         TxtTask.Text = "";
     }
 }
Exemple #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                object[] data = (object[])e.Parameter;
                isConnected = (bool)data[0];
                string[] task = (string[])data[1];

                foreach (string s in task)
                {
                    CustomItemList item = new CustomItemList(s)
                    {
                        IsEnabled = false
                    };
                    ListTask.Items.Add(item);
                }
            }
            catch (InvalidCastException ex)
            {
                isConnected = (bool)e.Parameter;
            }
        }