iWOWS/WolfOfWallStreet/Views/Controllers/MofidOnlineController.xaml.cs

44 lines
1.2 KiB
C#

using System;
using System.Windows;
using System.Windows.Controls;
using HandyControl.Controls;
using WolfOfWallStreet.Models;
using WolfOfWallStreet.ViewModels;
namespace WolfOfWallStreet.Views.Controllers
{
/// <summary>
/// Interaction logic for MofidOnlineController
/// </summary>
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;
}
}
}