本文整理汇总了C#中IMvxMessenger类的典型用法代码示例。如果您正苦于以下问题:C# IMvxMessenger类的具体用法?C# IMvxMessenger怎么用?C# IMvxMessenger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMvxMessenger类属于命名空间,在下文中一共展示了IMvxMessenger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainViewModel
public MainViewModel(ISampleAppService sampleappservice, IMvxMessenger messenger)
{
_sampleAppService = sampleappservice;
ReloadList();
_messenger = messenger;
_listChangedToken = _messenger.Subscribe<SampleAppChangedMessage>(OnListChanged);
}
示例2: FolderControllerViewModel
public FolderControllerViewModel(IFolderObserver observer, IMvxMessenger hub)
{
this.observer = observer;
this.hub = hub;
this.files = new Dictionary<string, DateTime>(64);
this.mvxSubscriptionToken = hub.Subscribe<NewFileMessage>(this.NewFileReceived);
}
示例3: SettingsViewModel
public SettingsViewModel (IMvxMessenger messenger) : base()
{
_messenger = messenger;
ServerAddress = AppSettings.ServerlUrl;
AzureADAuthorizationEnabled = Settings.ADAuthenticationEnabled;
}
示例4: BettrFitDataSource
/// <summary>
/// Konstruktor
/// </summary>
/// <param name="nav"></param>
/// <param name="events"></param>
/// <param name="sync"></param>
public BettrFitDataSource()
{
_sync = new SyncDataViewModel();
Server = "https://www.bettrfit.com";
UserData = new UserVM();
UserGoals = new ObservableCollection<UserGoalVM>();
Auth = new WebAccess.ServiceReference.AuthData();
UserDaily = new ObservableCollection<UserDailyVM>();
NutritionPlanFavorites = new ObservableCollection<NutritionPlanFavoriteVM>();
NutritionPlanLeb = new ObservableCollection<LebensmittelVM>();
SummaryConsumedDaytime = new WebAccess.ServiceReference.SummaryData();
SummaryConsumedDay = new WebAccess.ServiceReference.SummaryData();
_messenger = Mvx.Resolve<IMvxMessenger>();
_mapper = new InitMapper();
_messenger.Subscribe<NetworkEvent>(m => IsNetworkAvailable = m.IsAvailable);
LoadAll();
CheckLogin();
//if (ret == 0)
//{
// _EventAggregator = Container.Resolve<IEventAggregator>();
// _EventAggregator.GetEvent<LoggedInEvent>().Publish(true);
// _ds._loggedIn = true;
//}
}
示例5: JabbrService
public JabbrService()
{
Connections = new ObservableCollection<JabbrConnection> ();
Settings = Mvx.Resolve<ISettingsService> ();
Messenger = Mvx.Resolve<IMvxMessenger> ();
Settings.Accounts.CollectionChanged += (sender, e) => {
if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
{
foreach (Account a in e.OldItems)
{
var cons = Connections.Where(c => c.Account.Id == a.Id);
if (cons != null)
foreach (var con in cons)
con.Client.Disconnect();
}
}
else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
{
foreach (Account a in e.NewItems)
{
if (Connections.Where(con => con.Account.Id == a.Id).Count() <= 0)
AddClient(a);
}
}
Messenger.Publish<AccountsChangedMessage>(new AccountsChangedMessage(this));
};
}
示例6: LiveCardPresenter
public LiveCardPresenter()
{
_messenger = Mvx.Resolve<IMvxMessenger>();
_messenger.Subscribe<ServiceStartedMessage>(onServiceStart);
_messenger.Subscribe<ServiceDestroyedMessage>(onServiceDestroyed);
_messenger.Subscribe<GlassShowViewModelMessage>(onShowViewModel);
}
示例7: SelectCategoryListViewModel
/// <summary>
/// Creates an CategoryListViewModel for the usage of providing a CategoryViewModel selection.
/// </summary>
/// <param name="categoryRepository">An instance of <see cref="IRepository{T}" />.</param>
/// <param name="modifyDialogService">An instance of <see cref="IModifyDialogService" /></param>
/// <param name="dialogService">An instance of <see cref="IDialogService" /></param>
/// <param name="messenger">An instance of <see cref="IMvxMessenger" /></param>
public SelectCategoryListViewModel(ICategoryRepository categoryRepository,
IModifyDialogService modifyDialogService,
IDialogService dialogService, IMvxMessenger messenger)
: base(categoryRepository, modifyDialogService, dialogService)
{
this.messenger = messenger;
}
示例8: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
_messageHub = Mvx.Resolve<IMvxMessenger>();
var url = Intent.GetStringExtra("cheesebaron.mvxplugins.azureaccesscontrol.droid.Url");
Window.RequestFeature(WindowFeatures.Progress);
_webView = new WebView(this)
{
VerticalScrollBarEnabled = true,
HorizontalScrollBarEnabled = true,
ScrollBarStyle = ScrollbarStyles.OutsideOverlay,
ScrollbarFadingEnabled = true
};
_webView.Settings.JavaScriptEnabled = true;
_webView.Settings.SetSupportZoom(true);
_webView.Settings.BuiltInZoomControls = true;
_webView.Settings.LoadWithOverviewMode = true; //Load 100% zoomed out
var notify = new AccessControlJavascriptNotify();
notify.GotSecurityTokenResponse += GotSecurityTokenResponse;
_webView.AddJavascriptInterface(notify, "external");
_webView.SetWebViewClient(new AuthWebViewClient());
_webView.SetWebChromeClient(new AuthWebChromeClient(this));
_webView.LoadUrl(url);
AddContentView(_webView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));
}
示例9: SettingsViewModel
public SettingsViewModel(
IApplicationSettingServiceSingleton applicationSettingService,
IMvxMessenger messenger,IUserInteraction userInteraction)
{
if (applicationSettingService == null)
{
throw new ArgumentNullException("applicationSettingService");
}
if (messenger == null)
{
throw new ArgumentNullException("messenger");
}
if (userInteraction == null)
{
throw new ArgumentNullException("userInteraction");
}
_applicationSettingService = applicationSettingService;
_messenger = messenger;
_userInteraction = userInteraction;
this.InitializeCommands();
this.InitializeActions();
}
示例10: LocationService
public LocationService(IMvxGeoLocationWatcher watcher, IMvxMessenger messenger)
{
_messenger = messenger;
_watcher = watcher;
_watcher.Start(new MvxGeoLocationOptions(), OnSuccess, OnError);
}
示例11: GoalEditViewModel
public GoalEditViewModel()
{
//this.DefaultViewModel["Lebensmittel"] = ds.CurrentLebensmittel;
//this.DefaultViewModel["Items"] = ds.LebensmittelConsumed;
//this.DefaultViewModel["SelectedConsumed"] = ds.SelectedConsumed;
//this.DefaultViewModel["Search"] = ds.LebensmittelResult;
//this.DefaultViewModel["CurrentLebensmittel"] = ds.CurrentLebensmittel;
//this.DefaultViewModel["SummaryConsumedDay"] = ds.SummaryConsumedDay;
//this.DefaultViewModel["SummaryConsumedDaytime"] = ds.SummaryConsumedDaytime;
//SelectedConsumed = null;
_messenger = Mvx.Resolve<IMvxMessenger>();
//_logintoken = _messenger.Subscribe<LoggedInEvent>(a => LoginChanged(a.LoggedIn));
_synctoken = _messenger.Subscribe<SyncEvent>(a => RaisePropertyChanged("Sync"));
SaveDailyCommand = new MvxCommand(SaveDaily, canSaveDaily);
NewRecord = false;
WorkoutMinutes = new ObservableCollection<int>() { 20, 40, 60 };
WorkoutDays = new ObservableCollection<int>() { 1, 3, 5 };
_goal_Endurance = CurrentGoal.Goal_Endurance;
_goal_FatLoss = CurrentGoal.Goal_FatLoss;
_goal_Muscle = CurrentGoal.Goal_Muscle;
OnPropertyChanged("Goal_Muscle");
OnPropertyChanged("Goal_Endurance");
OnPropertyChanged("Goal_FatLoss"); ;
}
示例12: ScanViewModel
public ScanViewModel(IMvxMessenger mvxMessenger)
{
_mvxMessenger = mvxMessenger;
_scanSubscriptionTokenToken =
_mvxMessenger.Subscribe<ScanMessage>(OnScan);
}
示例13: TimerService
public TimerService(IMvxMessenger messenger)
{
this.messenger = messenger;
timerId = 0;
StartTimer();
}
示例14: BaseViewModel
public BaseViewModel(IMvxMessenger messenger) : base()
{
_messenger = messenger;
_token = _messenger.Subscribe<ReloadDataMessage>(async _ =>
await ReloadDataAsync());
}
示例15: CompanyRidesViewModel
public CompanyRidesViewModel(IMyShuttleClient myShuttleClient,
IApplicationSettingServiceSingleton applicationSettingService,
IMvxMessenger messenger)
: base(myShuttleClient, applicationSettingService,messenger)
{
InitializeCommands();
}