Beispiel #1
0
        public void InitializeMainButton()
        {
            var MainButton = new CxControlLibrary.MainButton();

            MainButton.HorizontalAlignment = HorizontalAlignment.Center;
            MainButton.Enabled             = true;


            //ImageButton icon save and change
            var saveIconBitMap = new BitmapImage();

            saveIconBitMap.BeginInit();
            saveIconBitMap.UriSource = new Uri("pack://application:,,,/Icon/MainButton/ProtectAndSave.png");
            saveIconBitMap.EndInit();

            MainButton.IconRegular  = saveIconBitMap;
            MainButton.IconHover    = saveIconBitMap;
            MainButton.IconPressed  = saveIconBitMap;
            MainButton.IconDisabled = saveIconBitMap;

            XAMLStackPanel.Children.Add(MainButton); //add to Xaml

            MainButton.Name   = "MainButton";
            MainButton.Margin = new Thickness(5);
        }
Beispiel #2
0
        public void InitializeMainButton3()
        {
            var MainButton = new CxControlLibrary.MainButton();

            MainButton.HorizontalAlignment = HorizontalAlignment.Center;
            MainButton.Enabled             = true;


            //ImageButton icon save and change
            var saveIconBitMap = new BitmapImage();

            saveIconBitMap.BeginInit();
            saveIconBitMap.UriSource = new Uri(@"C:\\Users\Yuriy\Desktop\temp2.PNG");
            saveIconBitMap.EndInit();

            MainButton.IconRegular  = saveIconBitMap;
            MainButton.IconHover    = saveIconBitMap;
            MainButton.IconPressed  = saveIconBitMap;
            MainButton.IconDisabled = saveIconBitMap;

            XAMLStackPanel.Children.Add(MainButton); //add to Xaml

            MainButton.Name   = "MainButton";
            MainButton.Margin = new Thickness(5);
        }
        private void MainButton_ButtonClick(object sender, EventArgs e)
        {
            MainButton btn = sender as MainButton;

            if (btn.ContentText == "Yes")
            {
                DialogResult = CxDialogResultEnum.Yes;
            }
            if (btn.ContentText == "No")
            {
                DialogResult = CxDialogResultEnum.No;
            }

            MessageBox.Show(DialogResult.ToString());
            this.Close();
        }
Beispiel #4
0
        public void InitializeSubButton()
        {
            var SubButton = new CxControlLibrary.MainButton();

            SubButton.HorizontalAlignment = HorizontalAlignment.Center;
            SubButton.Enabled             = true;
            SubButton.ContentText         = String.Empty;//if string is Empty MainButton convert to SubButton

            //Change Beackgroound
            SubButton.BackgroundRegular  = new SolidColorBrush(Colors.White);
            SubButton.BackgroundHover    = new SolidColorBrush(Color.FromRgb(198, 233, 253));
            SubButton.BackgroundPressed  = new SolidColorBrush(Color.FromRgb(114, 179, 216));
            SubButton.BackgroundDisabled = new SolidColorBrush(Color.FromRgb(183, 183, 183));

            XAMLStackPanel.Children.Add(SubButton); //add to Xaml

            SubButton.Name   = "SubButton";
            SubButton.Margin = new Thickness(5);
        }