public AtmButtonControl(AtmButton atmButton) { InitializeComponent(); ButtonText0 = atmButton.Text0; ButtonText1 = atmButton.Text1; ButtonText2 = atmButton.Text2; ButtonText3 = atmButton.Text3; Text0Color = atmButton.Text0Color.ToString() != "#00000000" ? atmButton.Text0Color : Colors.White; Text1Color = atmButton.Text1Color.ToString() != "#00000000" ? atmButton.Text1Color : Colors.White; Text2Color = atmButton.Text2Color.ToString() != "#00000000" ? atmButton.Text2Color : Colors.White; Text3Color = atmButton.Text3Color.ToString() != "#00000000" ? atmButton.Text3Color : Colors.White; MainText.Text = atmButton.MainText; ImagePath = atmButton.ImagePath; Name = atmButton.Name + DateTime.Now.Ticks; ButtonImage.SetValue(NameProperty, Name); MainText.SetValue(NameProperty, Name); Text0.SetValue(NameProperty, Name); Text1.SetValue(NameProperty, Name); Text2.SetValue(NameProperty, Name); Text3.SetValue(NameProperty, Name); IsRightButton = atmButton.IsRightButton; if (IsRightButton) { ButtonGrid.HorizontalAlignment = HorizontalAlignment.Right; } }