Ejemplo n.º 1
0
		ObservableCollection<MenuModel> GetLanguageMenuItems()
		{
			CultureInfo language = App.Language;
			var menuitem = new MenuModel();
			menuitem.Header = language.DisplayName;
			menuitem.Icon = @"/rbscan;component/Resources/Globe-100.png";

			foreach ( var lang in App.Languages )
			{
				var item = new MenuModel();
				item.Header = lang.DisplayName;
				item.Command = ChangeLanguageCommand;
				item.CommandParameter = lang.DisplayName;
				item.IsChecked = lang.Equals( language );
				menuitem.Items.Add( item );
			}

			var result = new ObservableCollection<MenuModel>();
			result.Add( menuitem );
			return result;
		}
Ejemplo n.º 2
0
		internal ObservableCollection<MenuModel> GetScannersMenuItems()
		{
			// header
			var menuitem = new MenuModel();
			menuitem.Header = GetCurrentScannerName();
			menuitem.Icon = ( Devices.Count > 0 ) ?
				@"/rbscan;component/Resources/Connected-50.png" :
				@"/rbscan;component/Resources/Disconnected-50.png";

			if ( Devices.Count > 0 )
			{
				foreach ( var device in Devices )
				{
					var deviceItem = new MenuModel();
					deviceItem.Header = device.Value;
					deviceItem.Command = SelectDeviceCommand;
					deviceItem.CommandParameter = device.Key;
					deviceItem.IsChecked = ( Device == device.Key ) ? true : false;
					menuitem.Items.Add( deviceItem );
				}
				ScanCommand.RaiseCanExecuteChanged();
			}

			var result = new ObservableCollection<MenuModel>();
			result.Add( menuitem );
			return result;
		}