예제 #1
0
        private static void OnBarabanNamePropertyChanged(DependencyObject dependencyObject,
                                                         DependencyPropertyChangedEventArgs e)
        {
            ctrlBaraban myUserControl = dependencyObject as ctrlBaraban;

            myUserControl.OnPropertyChanged("BarabanName");
            myUserControl.lblName.Content = myUserControl.BarabanName;
        }
예제 #2
0
        private static void OnMoneyValuePropertyChanged(DependencyObject dependencyObject,
                                                        DependencyPropertyChangedEventArgs e)
        {
            ctrlBaraban myUserControl = dependencyObject as ctrlBaraban;

            myUserControl.OnPropertyChanged("MoneyValue");
            //myUserControl.lblMoneyValue.Content = myUserControl.MoneyValue/100+ " р.";
            myUserControl.txtMoneyValue.Text = myUserControl.MoneyValue / 100 + " р.";

            //  myUserControl.lblMoneyColor.Height = Math.Max(30, (int)(double)(myUserControl.lblMoneyValue.ActualHeight * myUserControl.PercentOfFull));
            //   myUserControl.lblMoneyColor.Content = myUserControl.MoneyCount + " банкнот";
        }
예제 #3
0
        private static void OnAddMoneyValuePropertyChanged(DependencyObject dependencyObject,
                                                           DependencyPropertyChangedEventArgs e)
        {
            ctrlBaraban myUserControl = dependencyObject as ctrlBaraban;

            myUserControl.OnPropertyChanged("AddMoneyValue");
            if (myUserControl.AddMoneyValue == 0)
            {
                myUserControl.lblAddValue.Background = new SolidColorBrush(Colors.White);
                myUserControl.lblAddValue.Content    = "";
            }
            else
            {
                myUserControl.lblAddValue.Background = new SolidColorBrush(Colors.LightGreen);
                myUserControl.lblAddValue.Content    = "+" + (myUserControl.AddMoneyValue / 100).ToString() + " р.";
            }

            // myUserControl.lblMoneyValue.Content = myUserControl.AddMoneyValue / 100 + " р.";
        }
예제 #4
0
        private static void OnDenomValuePropertyChanged(DependencyObject dependencyObject,
                                                        DependencyPropertyChangedEventArgs e)
        {
            ctrlBaraban myUserControl = dependencyObject as ctrlBaraban;

            myUserControl.OnPropertyChanged("DenomValue");

            if (myUserControl.DenomValue == 0)
            {
                myUserControl.lblDenomValue.Content = "";
                //myUserControl.txtMoneyValue.Text = "";
            }
            else
            {
                string Post = myUserControl.DenomValue >= 100 ? "р." : "коп.";
                int    del  = myUserControl.DenomValue >= 100 ? 100 : 1;
                myUserControl.lblDenomValue.Content = (myUserControl.DenomValue / del).ToString() + " " + Post;
                //myUserControl.txtMoneyValue.Text = (myUserControl.DenomValue / del).ToString() + " " + Post;
            }
        }
예제 #5
0
        private static void OnMoneyStatePropertyChanged(DependencyObject dependencyObject,
                                                        DependencyPropertyChangedEventArgs e)
        {
            ctrlBaraban myUserControl = dependencyObject as ctrlBaraban;

            myUserControl.OnPropertyChanged("MoneyState");

            switch (myUserControl.MoneyState)
            {
            case 0:
                myUserControl.lblMoneyColor.Background = new SolidColorBrush(Colors.Red);
                break;

            case 1:
                myUserControl.lblMoneyColor.Background = new SolidColorBrush(Colors.LightPink);
                break;

            case 2:
                myUserControl.lblMoneyColor.Background = new SolidColorBrush(Colors.LightGray);
                break;

            case 3:
                myUserControl.lblMoneyColor.Background = new SolidColorBrush(Colors.LightBlue);
                break;

            case 4:
                myUserControl.lblMoneyColor.Background = new SolidColorBrush(Colors.Blue);
                break;



            default:
                break;
            }


            //myUserControl.lblMoneyValue.b = myUserControl.MoneyValue / 100 + " р.";
        }