using System; using System.Windows; using System.Windows.Controls; using HandyControl.Controls; using WolfOfWallStreet.Models; using WolfOfWallStreet.ViewModels; namespace WolfOfWallStreet.Views.Controllers { /// /// Interaction logic for MofidOnlineController /// public partial class MofidOnlineController : UserControl { private Tag selecteTag; public MofidOnlineController() { InitializeComponent(); } private void SymbolTag_OnSelected(object sender, EventArgs e) { if (selecteTag != null) { selecteTag.IsSelected = false; } if (sender is Tag tag && tag.DataContext is Symbol symbol && DataContext is MofidOnlineControllerViewModel viewModel) { viewModel.SelectSymbolCommand.Execute(symbol); selecteTag = tag; } } private void StackToggleButton_OnChecked(object sender, RoutedEventArgs e) { if (sender is RadioButton radioButton && radioButton.DataContext is int stock && DataContext is MofidOnlineControllerViewModel viewModel) viewModel.Stock = stock; } } }