本文整理汇总了C#中INavigation类的典型用法代码示例。如果您正苦于以下问题:C# INavigation类的具体用法?C# INavigation怎么用?C# INavigation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INavigation类属于命名空间,在下文中一共展示了INavigation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public void Init()
{
var mock = MockRepository.GenerateMock(typeof(IWebDriver), new[] { typeof(IJavaScriptExecutor) });
this.webDriver = (IWebDriver)mock;
this.javaScriptExecutor = (IJavaScriptExecutor)mock;
this.navigation = MockRepository.GenerateStub<INavigation>();
}
示例2: ExpenseViewModel
public ExpenseViewModel(INavigation navigation)
{
_navigation = navigation;
_expenseService = DependencyService.Get<IExpenseService>();
SelectedDate = DateTime.Now;
LoadData();
MessagingCenter.Subscribe<AddViewModel, Expense>(this, "AddExpense", async (sender, arg) =>
{
try
{
await _expenseService.AddExpenseAsync(arg).ConfigureAwait(false);
}
catch (Exception ex)
{
Debug.WriteLine("Error occured during insertion : "+ex.Message);
}
LoadData();
});
MessagingCenter.Subscribe<ExpenseItemViewModel, int>(this, "DeleteExpense", async (sender, arg) =>
{
try
{
await _expenseService.DeleteExpenseAsync(arg).ConfigureAwait(false);
}
catch (Exception ex)
{
Debug.WriteLine("Error occured during delete of expense : "+ex.Message);
}
LoadData();
});
}
示例3: CustomerTabbedPage
public CustomerTabbedPage(INavigation navigation, Account account)
{
// since we're modally presented this tabbed view (because Android doesn't natively support nested tabs),
// this tool bar item provides a way to get back to the Customers list
ToolbarItems.Add(new ToolbarItem(TextResources.Customers_Orders_CustomerTabbedPage_BackToCustomers, null, async () => await navigation.PopModalAsync()));
CustomerDetailPage customerDetailPage = new CustomerDetailPage()
{
BindingContext = new CustomerDetailViewModel(account) { Navigation = this.Navigation },
Title = TextResources.Customers_Detail_Tab_Title,
Icon = new FileImageSource() { File = "CustomersTab" } // only used on iOS
};
CustomerOrdersPage customerOrdersPage = new CustomerOrdersPage()
{
BindingContext = new OrdersViewModel(account) { Navigation = this.Navigation },
Title = TextResources.Customers_Orders_Tab_Title,
Icon = new FileImageSource() { File = "ProductsTab" } // only used on iOS
};
CustomerSalesPage customerSalesPage = new CustomerSalesPage()
{
BindingContext = new CustomerSalesViewModel(account) { Navigation = this.Navigation },
Title = TextResources.Customers_Sales_Tab_Title,
Icon = new FileImageSource() { File = "SalesTab" } // only used on iOS
};
Children.Add(customerDetailPage);
Children.Add(customerOrdersPage);
Children.Add(customerSalesPage);
}
示例4: SearchViewModel
public SearchViewModel(INavigation navigation)
{
if (navigation != null)
_navigation = navigation;
FindCommand = new Command<String>(searchText =>
{
this.SearchPattern = searchText;
TwitterClient client = TwitterClient.GetInstance();
IEnumerable<ITweet> tweets = client.SearchTweets(SearchPattern);
TweetsFoundCollection = new ObservableCollection<ITweet>(tweets);
}
);
ToMainCommand = new Command(async () =>
{
if (_navigation != null)
await _navigation.PopAsync();
});
SignupCommand = new Command<Object>(signup =>
{
TwitterClient client = TwitterClient.GetInstance();
var tweet = signup as ITweet;
if (tweet != null)
{
Int64 id = tweet.CreatedBy.Id;
client.FollowUser(id);
}
},
value => { return TweetsFoundCollection != null; });
}
示例5: MainViewModel
public MainViewModel(INavigation navigation)
{
_navigation = navigation;
}
示例6: ContactListViewModel
public ContactListViewModel(INavigation navigation)
{
_navigation = navigation;
_contactsService = ServiceLocator.ContactsService;
Contacts = new ObservableCollection<Contact>();
}
示例7: EventDetailsViewModel
public EventDetailsViewModel(INavigation navigation, FeaturedEvent e) : base(navigation)
{
Event = e;
Sponsors = new ObservableRangeCollection<Sponsor>();
if (e.Sponsor != null)
Sponsors.Add(e.Sponsor);
}
示例8: AccountSettingsViewModel
public AccountSettingsViewModel(
INavigation navigation,
IAppSettings appSettings)
: base(navigation)
{
this.appSettings = appSettings;
}
示例9: TryFindPrincipal
private object TryFindPrincipal(StateManager stateManager, INavigation navigation, object dependentEntity)
{
if (navigation.PointsToPrincipal)
{
return _getterSource.GetAccessor(navigation).GetClrValue(dependentEntity);
}
// TODO: Perf
foreach (var principalEntry in stateManager.StateEntries
.Where(e => e.EntityType == navigation.ForeignKey.ReferencedEntityType))
{
if (navigation.IsCollection())
{
if (_collectionAccessorSource.GetAccessor(navigation).Contains(principalEntry.Entity, dependentEntity))
{
return principalEntry.Entity;
}
}
else if (_getterSource.GetAccessor(navigation).GetClrValue(principalEntry.Entity) == dependentEntity)
{
return principalEntry.Entity;
}
}
return null;
}
示例10: ContactViewModel
public ContactViewModel(INavigation navigation, Contact contact)
{
_navigation = navigation;
_contactData = new ContactDataService();
FillingCurrentContact(contact);
AddContactCommand = new Command(() => NewContact(contact));
}
示例11: FindBleViewModel
public FindBleViewModel (INavigation navigation, bool selMeuSkey)
{
fim = false;
this.selMeuSkey = selMeuSkey;
App.gateSkey = null; //sKey selecionada se for scan para gateDevice
keySelecionada = null; //resultado da acao de click em item da lista de sKeys encontrados
if (selMeuSkey || App.gateSkeys == null)
devices = new ObservableCollection<BleDevice> ();
else
devices = new ObservableCollection<BleDevice> (App.gateSkeys); //Skeys do ultimo scan
if (selMeuSkey && MySafetyDll.MySafety.isScanning)
((App)Application.Current).mysafetyDll.cancelScan ();
((App)Application.Current).mysafetyDll.Scan += mysafetyDll_Scan;
_navigation = navigation;
FindCommand = new Command ((key) => {
findBleButton = (Button)key;
scanSkeys ();
});
//
if (devices.Count () == 0)
scanSkeys ();
}
示例12: NewsViewModel
public NewsViewModel(INavigation navigation) : base(navigation)
{
Items = new ObservableCollection<NewsItem>();
Items.Add(new NewsItem() { Header = "Leksand till SHL", Text = "Leksand spelar i SHL 16/17! :)" });
Items.Add(new NewsItem() { Header = "Microsoft köper Xamarin", Text = "Xamarin är nu gratis för alla!!" });
Items.Add(new NewsItem() { Header = "Sogeti + Xamarin", Text = "Sogeti utbildar nya Xamarinutvecklare!" });
}
示例13: ChooseViewModel
public ChooseViewModel(INavigation navi)
{
this.navigation = navi;
this.likeMealCommand = new Command(async () =>
{
likedMeals.Add(Meal);
if (!LoadNewMeal())
{
await this.LoadOverviewPage();
}
});
this.dislikeMealCommand = new Command(async () =>
{
dislikedMeals.Add(Meal);
if (!LoadNewMeal())
{
await this.LoadOverviewPage();
}
});
this.enoughMealsCommand = new Command(async () =>
{
await this.LoadOverviewPage();
});
this.likedMeals = new List<Meal>();
this.dislikedMeals = new List<Meal>();
this.LoadNewMeal ();
}
示例14: SalesDashboardLeadsViewModel
public SalesDashboardLeadsViewModel(Command pushTabbedLeadPageCommand, INavigation navigation = null)
: base(navigation)
{
_PushTabbedLeadPageCommand = pushTabbedLeadPageCommand;
_DataClient = DependencyService.Get<IDataClient>();
Leads = new ObservableCollection<Account>();
MessagingCenter.Subscribe<Account>(this, MessagingServiceConstants.SAVE_ACCOUNT, (account) =>
{
var index = Leads.IndexOf(account);
if (index >= 0)
{
Leads[index] = account;
}
else
{
Leads.Add(account);
}
Leads = new ObservableCollection<Account>(Leads.OrderBy(l => l.Company));
});
IsInitialized = false;
}
示例15: LeadDetailViewModel
public LeadDetailViewModel(INavigation navigation, Account lead = null)
{
if (navigation == null)
{
throw new ArgumentNullException("navigation", "An instance of INavigation must be passed to the LeadDetailViewModel constructor.");
}
Navigation = navigation;
if (lead == null)
{
Lead = new Account();
this.Title = TextResources.Leads_NewLead;
}
else
{
Lead = lead;
this.Title = lead.Company;
}
this.Icon = "contact.png";
_DataClient = DependencyService.Get<IDataClient>();
_GeoCodingService = DependencyService.Get<IGeoCodingService>();
}