コード例 #1
0
 public object Convert(object value, Type typeTarget, object param, System.Globalization.CultureInfo culture)
 {
     if (value == null)
     {
         return("White");
     }
     else
     {
         for (int i = 0; i < ShiftsInforService.RetrieveShiftsInforList().Count; i++)
         {
             if (value.ToString() == ShiftsInforService.RetrieveShiftsInforList()[i].WorkTime)
             {
                 return(ShiftsInforService.RetrieveShiftsInforList()[i].Corlor);
             }
         }
     }
     return("White");
 }
コード例 #2
0
        public void OnCollectionChange(object lang)
        {
            CategoryItem item1 = new CategoryItem();
            CategoryItem item2 = new CategoryItem();
            CategoryItem item3 = new CategoryItem();

            if (lang.ToString().Equals("en-US"))                    // If English button is pressed
            {
                item1.ButtonContent = EnglishCategory.SaveButton;
                item1.ButtonTag     = ButtonNames.SaveButton;

                item2.ButtonContent = EnglishCategory.OpenButton;
                item2.ButtonTag     = ButtonNames.OpenButton;

                item3.ButtonContent = EnglishCategory.CloseButton;
                item3.ButtonTag     = ButtonNames.CloseButton;
            }
            else                                                    // If Danish button is pressed
            {
                item1.ButtonContent = DanishCategory.SaveButton;
                item1.ButtonTag     = ButtonNames.SaveButton;

                item2.ButtonContent = DanishCategory.OpenButton;
                item2.ButtonTag     = ButtonNames.OpenButton;

                item3.ButtonContent = DanishCategory.CloseButton;
                item3.ButtonTag     = ButtonNames.CloseButton;
            }


            CategoryButtonList = new List <ShiftsInformation>();           // Intialize the button list
            CategoryButtonList = ShiftsInforService.RetrieveShiftsInforList();
            //CategoryButtonList.Add(item1);
            //CategoryButtonList.Add(item2);
            //CategoryButtonList.Add(item3);
        }
コード例 #3
0
 public void OnCollectionChange(object lang)
 {
     CategoryButtonList = new ObservableCollection <ShiftsInformation>(ShiftsInforService.RetrieveShiftsInforList());
 }
コード例 #4
0
 public ShiftsSettingViewModel()
 {
     this.DeleteCommand         = new DelegateCommand(DeleteCommandExecute, arg => true);
     this.CloseCommand          = new DelegateCommand(CloseCommandExecute, arg => true);
     this.SaveCommand           = new DelegateCommand(SaveCommandExecute, arg => true);
     this.UpCommand             = new DelegateCommand(UpCommandExecute, arg => true);
     this.DownCommand           = new DelegateCommand(DownCommandExecute, arg => true);
     this.ShiftsInformationList = new ObservableCollection <ShiftsInformation>(ShiftsInforService.RetrieveShiftsInforList());
 }