private void OnStartup(object sender, StartupEventArgs e) { // Setup MEF. Network.DownloadCatalog = new AggregateCatalog(); CompositionHost.Initialize(new DeploymentCatalog(), Network.DownloadCatalog); // Load the view. var rootView = new RootViewModel().CreateView(); RootVisual = rootView; // Process any instructions in the query-string. var queryString = new QueryString(); queryString.StartTestRun(); }
public void Initialize() { TestHarnessModel.ResetSingleton(); var testHarness = TestHarnessModel.Instance; testHarness.Modules.RemoveAll(); classModel = new ViewTestClass(typeof(SampleViewTestClass1), "File.xap"); moduleModel = new ViewTestClassesAssemblyModule(new ModuleSetting(GetType().Assembly.FullName, "File.xap")); moduleModel.Classes.Add(classModel); testHarness.Modules.Add(moduleModel); rootVm = new RootViewModel(); selectorPanelVm = new SelectorPanelViewModel(rootVm); }
public SelectorPanelViewModel(RootViewModel parent) { // Setup initial conditions. this.parent = parent; model = TestHarnessModel.Instance; modules = new ObservableCollectionWrapper<ViewTestClassesModule, ModuleNodeViewModel>(model.Modules, item => new ModuleNodeViewModel(item)); Strings = new StringLibrary(); // Create commands. AddAssemblyCommand = new DelegateCommand<Button>(param => OnAddAssemblyClick()); AutoRunTestsCommand = new DelegateCommand<Button>(param => OnAutoRunTestsClick()); RunUnitTests = new DelegateCommand<Button>(param => OnRunUnitTests()); // Wire up events. model.PropertyChanged += (sender, e) => { if (e.PropertyName == TestHarnessModel.PropCurrentClass) UpdateTestSelectorModel(); }; }
public MainWindow(string fileName) { InitializeComponent(); if (!string.IsNullOrWhiteSpace(fileName) && File.Exists(fileName)) { try { var _mainWindow = new VCardsViewModel(new PhoneBookDialogService(), new VCardFileService(), new ImageDialogService(), new string[] { fileName }); DataContext = new RootViewModel() { RootVM = _mainWindow }; } catch (Exception ex) { MessageBox.Show(ex.Message); var _mainWindow = new VCardsViewModel(new PhoneBookDialogService(), new VCardFileService(), new ImageDialogService()); DataContext = new RootViewModel() { RootVM = _mainWindow }; } } }
public BuildTreeViewControl(ObservableCollection <LogViewModel> logs) { InitializeComponent(); DataContext = new RootViewModel(logs); }
private async Task Create() { model = await new RootModelFactoryTest().ConstructedModel(); sut = new RootViewModel(model); }
public FinishView(RootViewModel viewModel) : base(viewModel) { DataContext = viewModel; InitializeComponent(); }
public MainWindow() { InitializeComponent(); DataContext = new RootViewModel(); }
public override IRootDock CreateLayout() { var leftFloating = GetDefaultFloatingWindowsByPostion(DefaultFloatingPostion.Left); var rightFloating = GetDefaultFloatingWindowsByPostion(DefaultFloatingPostion.Right); var listDocuments = new List <IDockable>(); foreach (var item in _defaultDocumentTools) { listDocuments.Add(ConstructToolWindow(item.Value)); } var documentDock = new DocumentDock() { Id = "DocumentsPane", Title = "DocumentsPane", Proportion = double.NaN, ActiveDockable = (listDocuments.Count > 0) ? listDocuments[0] : null, VisibleDockables = listDocuments, IsCollapsable = false }; var horizontalDockables = CreateList <IDockable>( documentDock ); if (leftFloating.Count > 0) { horizontalDockables.Insert(0, new ToolDock() { Id = "LeftPaneTop", Title = "LeftPaneTop", Proportion = 1 / 4D, ActiveDockable = leftFloating[0], VisibleDockables = leftFloating }); horizontalDockables.Insert(1, new SplitterDockable() { Id = "LeftSplitter", Title = "LeftSplitter" }); } if (rightFloating.Count > 0) { horizontalDockables.Add(new SplitterDockable() { Id = "RightSplitter", Title = "RightSplitter" }); horizontalDockables.Add(new ToolDock() { Id = "RightPaneTop", Title = "RightPaneTop", Proportion = 1 / 4D, ActiveDockable = rightFloating[0], VisibleDockables = rightFloating }); } IDockable horizontalDock = new ProportionalDock() { Id = "LeftPane", Title = "LeftPane", Proportion = double.NaN, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = horizontalDockables }; var mainVisibleDockables = CreateList <IDockable>(horizontalDock); var mainLayout = new ProportionalDock { Id = "MainLayout", Title = "MainLayout", Proportion = double.NaN, Orientation = Orientation.Horizontal, ActiveDockable = null, VisibleDockables = mainVisibleDockables }; var rootViewModel = new RootViewModel() { Id = "Main", Title = "Main", ActiveDockable = mainLayout, VisibleDockables = CreateList <IDockable>(mainLayout) }; var root = CreateRootDock(); root.Id = "Root"; root.Title = "Root"; root.ActiveDockable = rootViewModel; root.DefaultDockable = rootViewModel; root.VisibleDockables = CreateList <IDockable>(rootViewModel); _rootDock = root; return(root); }
static void Main(string[] args) { IServiceCollection services = new ServiceCollection(); // Startup.cs finally :) Startup startup = new Startup(); startup.ConfigureServices(services); IServiceProvider serviceProvider = services.BuildServiceProvider(); startup.GetConfigs(); dataRepository = serviceProvider.GetService <IDataServices>(); imapper = serviceProvider.GetService <IMapper>(); ///////////Task 1 DateTime startdate = new DateTime(2019, 10, 01); DateTime endDate = new DateTime(2019, 10, 31); List <RootViewModel> Rates = new List <RootViewModel>(); foreach (DateTime day in Helpers.EachDay(startdate, endDate)) { RootViewModel rate = imapper.Map <Root, RootViewModel>(dataRepository.GetRate(day, "EUR")); Rates.Add(rate); } /////////Task 2 Console.WriteLine("API Accessed"); List <ExcelEntity> DataMerge = new List <ExcelEntity>(); DataMerge.AddRange(dataRepository.GetData(ConfigurationHelper.BasePath + "\\Data\\data1.csv")); DataMerge.AddRange(dataRepository.GetData(ConfigurationHelper.BasePath + "\\Data\\data2.csv")); DataMerge.AddRange(dataRepository.GetData(ConfigurationHelper.BasePath + "\\Data\\data3.csv")); ////////Task 3 var DataRatesJoin = (from rates in Rates join data in DataMerge on rates.Date equals data.date into dm from subData in dm.DefaultIfEmpty() select new { Date = rates.Date, Country = subData.country, currency = subData.currency, amount = subData.amount, rate = rates.Rates[subData.currency] }).ToList(); ////////Task 4 var DataRatesAddEur = (from rates in DataRatesJoin select new { Date = rates.Date, Country = rates.Country, Currency = rates.currency, Amount = rates.amount, Rate = rates.rate, amount_eur = rates.amount * rates.rate }).ToList(); ////////Task 5 List <DataRates> DataRatesAddEur2 = DataRatesAddEur.Select(e => new DataRates { Date = e.Date, Country = e.Country, Currency = e.Currency, Amount = e.Amount, Rate = e.Rate, amount_eur = e.amount_eur, country_group = e.Country == "Austria" || e.Country == "Italy" || e.Country == "Belgium" || e.Country == "Latvia" ? "EUR" : e.Country == "Chile" || e.Country == "Qatar" || e.Country == "United Arab Emirates" || e.Country == "United States of America" ? "ROW" : e.Country == "United Kingdom" || e.Country == "Australia" || e.Country == "South Africa" ? e.Country : "N/A" }).ToList(); ////////Task 6 var result = DataRatesAddEur2.GroupBy(a => a.country_group) .Select(a => new CountryTotal { TotalAmount = a.Sum(b => b.amount_eur), Country = a.Key }) .OrderByDescending(a => a.TotalAmount) .ToList(); }
private void Start() { this.itemViewModelData = RootViewModel.ConstructTreeFromDataModel(this.itemModelData); }
public LoginViewModel(RootViewModel rootViewModel) { this.rootViewModel = rootViewModel; CanLogin = true; WorkingText = "Login"; }
public BaseView(RootViewModel viewModel) { RootViewModel = viewModel; DataContext = viewModel; }
public ProgressView(RootViewModel viewModel) : base(viewModel) { DataContext = viewModel; InitializeComponent(); }
public LoadoutManager(RootViewModel rootViewModel) { this.rootViewModel = rootViewModel; this.rootViewModel.AbilitiesChanged += RootViewModel_AbilitiesChanged; }
public PuzzleFractionWrapper(RootViewModel rootViewModel) { rootViewModel.PuzzleFractions.Add(new PuzzleFractionViewModel()); _puzzleFraction = rootViewModel.PuzzleFractions[rootViewModel.PuzzleFractions.Count - 1]; }
public void Load(ContentManager contentManager) { SpriteFont font = contentManager.Load<SpriteFont>("Segoe_UI_15_Regular"); FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(font); _rootView = new RootView(); _rootViewModel = new RootViewModel(); _rootView.DataContext = _rootViewModel; FontManager.Instance.LoadFonts(contentManager); Time = new TextBlockWrapper(_rootViewModel.Time); Task = new TextBlockWrapper(_rootViewModel.Task); Score = new TextBlockWrapper(_rootViewModel.Score); Status = new TextBlockWrapper(_rootViewModel.Status); PuzzleFractions = new List<PuzzleFraction>(); }
public RootView() { InitializeComponent(); DataContext = new RootViewModel(); Closed += RootView_Closed; }
public RootPage() { BindingContext = new RootViewModel(); InitializeComponent(); MasterBehavior = MasterBehavior.Popover; }
public InstallDirView(RootViewModel viewModel) : base(viewModel) { DataContext = viewModel; InitializeComponent(); }
public UserControlItemsControl() { InitializeComponent(); DataContext = new RootViewModel(); }
public DbAccountView(RootViewModel viewModel) : base(viewModel) { DataContext = viewModel; InitializeComponent(); }
public PrintWindowViewModel(RootViewModel model) { RootViewModel = model; PrintIt = new RelayCommand(param => PrintItMethod(param)); CloseWindow = new RelayCommand(param => CloseWindowMethod(param)); }