mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
fixes up the crash of type casting (#21)
This commit is contained in:
parent
485d381eac
commit
eef9a539ca
1 changed files with 4 additions and 3 deletions
|
@ -1,9 +1,10 @@
|
||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
using CalculatorApp.ViewModel;
|
using CalculatorApp.ViewModel;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Windows.Foundation.Collections;
|
using Windows.Foundation.Collections;
|
||||||
|
@ -621,7 +622,7 @@ namespace CalculatorApp
|
||||||
var categoryName = AppResourceProvider.GetInstance().GetResourceString("DateCalculationModeText");
|
var categoryName = AppResourceProvider.GetInstance().GetResourceString("DateCalculationModeText");
|
||||||
appViewModel.CategoryName = categoryName;
|
appViewModel.CategoryName = categoryName;
|
||||||
|
|
||||||
var menuItems = ((IObservableVector<object>)navView.MenuItemsSource);
|
var menuItems = ((ObservableCollection<object>)navView.MenuItemsSource);
|
||||||
var flatIndex = NavCategory.GetFlatIndex(ViewMode.Date);
|
var flatIndex = NavCategory.GetFlatIndex(ViewMode.Date);
|
||||||
navView.SelectedItem = menuItems[flatIndex];
|
navView.SelectedItem = menuItems[flatIndex];
|
||||||
return;
|
return;
|
||||||
|
@ -710,7 +711,7 @@ namespace CalculatorApp
|
||||||
{
|
{
|
||||||
var navView = item as MUXC.NavigationView; // CSHARP_MIGRATION: TODO: check if this line is still needed
|
var navView = item as MUXC.NavigationView; // CSHARP_MIGRATION: TODO: check if this line is still needed
|
||||||
|
|
||||||
var menuItems = ((IObservableVector<object>)navView.MenuItemsSource);
|
var menuItems = ((ObservableCollection<object>)navView.MenuItemsSource);
|
||||||
if (menuItems != null)
|
if (menuItems != null)
|
||||||
{
|
{
|
||||||
var vm = (navView.DataContext as ApplicationViewModel);
|
var vm = (navView.DataContext as ApplicationViewModel);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue