private void ButtonBuyNow_Click(object sender, RoutedEventArgs e) { if (User.GetID() == -1) { GoToUserControlLogin(); } else { IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle; MainWindow window = (MainWindow)HwndSource.FromHwnd(windowHandle).RootVisual; UserControlCart userControlLogin = new UserControlCart(); window.GridHome.Children.Add(userControlLogin); } }
public void DeleteFromCart() { Server.SendString("cart_delete " + Id.ToString()); string response = Server.ReceiveResponse(); if (response == "Correct") { IntPtr windowHandle = new WindowInteropHelper(Application.Current.MainWindow).Handle; MainWindow window = (MainWindow)HwndSource.FromHwnd(windowHandle).RootVisual; UserControlCart ucObj = new UserControlCart(); window.GridHome.Children.Add(ucObj); } else { ErrorDelete.Content = "Błąd " + response + " " + Id.ToString(); } }
private void ButtonCart(object sender, RoutedEventArgs e) { UserControlCart ucObject = new UserControlCart(); GridHome.Children.Add(ucObject); }