xaml

MvvmCross: View inside another View (or the equivalent to a CaliburnMicro Conductor)

天涯浪子 提交于 2021-01-21 05:59:11
问题 I am pretty new to MvvmCross and the mvvm pattern in general, so I started a small learning project and immidiatly ran into a wall. I based my application on the idea of having a MainView which contains a standard Menu and a child MvxWpfView . This ChildView should be a simple ReadMeView first, but on user input it should switch to an other View (the one with actual data on it). I already found a few articles about this issue but none of them worked or i wasn't able to follow. My setup : Core

InitializeComponent() calling another method

这一生的挚爱 提交于 2021-01-20 08:37:32
问题 When I added the SelectionChanged event and of course the method in the code to handle the event to the following combobox: .... <ComboBox Name="OrderBox" HorizontalAlignment="Left" SelectionChanged="OrderBox_OnSelectionChanged"> <ComboBoxItem Margin="4,4,4,4" IsSelected="True">Por Nombre (A - Z)</ComboBoxItem> <ComboBoxItem Margin="4,4,4,4">Por Nombre (Z - A)</ComboBoxItem> <ComboBoxItem Margin="4,4,4,4">Por Apellido (A - Z)</ComboBoxItem> <ComboBoxItem Margin="4,4,4,4">Por Apellido (Z - A)<

WPF Input KeyBinding for a ListBox Item

霸气de小男生 提交于 2021-01-20 07:25:12
问题 I'm having a WPF Application, programatically I'm setting the focus to the ListBox Item, after that using UP / Down arrow I'm navigating from one Item to another Item. I need to Implement ENTER Key Event for that appropriate Item, it should trigger the ICommand SelectItemCommand in the ViewModel. Consider the ViewModel Code: public class MobileViewModel { public ObservableCollection<Mobile> MobileCollection { get; set; } public MobileViewModel() { MobileCollection = new ObservableCollection

WPF Input KeyBinding for a ListBox Item

送分小仙女□ 提交于 2021-01-20 07:23:23
问题 I'm having a WPF Application, programatically I'm setting the focus to the ListBox Item, after that using UP / Down arrow I'm navigating from one Item to another Item. I need to Implement ENTER Key Event for that appropriate Item, it should trigger the ICommand SelectItemCommand in the ViewModel. Consider the ViewModel Code: public class MobileViewModel { public ObservableCollection<Mobile> MobileCollection { get; set; } public MobileViewModel() { MobileCollection = new ObservableCollection

How to bind a CommandParameter in a ContentView to an element in the parent ContentPage in Xamarin Forms

孤街浪徒 提交于 2021-01-19 10:22:51
问题 I have a parent ContentPage with several ContentViews in separate files. I am trying to pass as reference an element in the parent ContentView to a CommandParameter in one of the views and below is the code I have thus far. This is parent ContentPage <?xml version="1.0" encoding="utf-8" ?> <ContentPage x:Class="Acies.NitroT.Views.Shop.RefillPage" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:base="clr-namespace:Acies.NitroT

WPF Contextmenu itemtemplate commandParameter binding returns null

早过忘川 提交于 2021-01-07 07:01:19
问题 I have a problem. I am trying to create a context menu with databinding in wpf. The context menu items would are bound to an observable collection of objects. The population of context menu is fine - however, I want to add the command to it. The way I am using it is: in XAML <Grid.Resources> <local:RestoreCommand x:Key="RestoreCommand" /> <local:ShowBalloonCommand x:Key="BaloonCommand" /> <local:StartTaskCommand x:Key="StartTaskCommand" /> </Grid.Resources> <ContextMenu ItemsSource="{Binding}

WPF Contextmenu itemtemplate commandParameter binding returns null

半世苍凉 提交于 2021-01-07 07:01:07
问题 I have a problem. I am trying to create a context menu with databinding in wpf. The context menu items would are bound to an observable collection of objects. The population of context menu is fine - however, I want to add the command to it. The way I am using it is: in XAML <Grid.Resources> <local:RestoreCommand x:Key="RestoreCommand" /> <local:ShowBalloonCommand x:Key="BaloonCommand" /> <local:StartTaskCommand x:Key="StartTaskCommand" /> </Grid.Resources> <ContextMenu ItemsSource="{Binding}

how to change the background color of flyout in uwp?

半世苍凉 提交于 2021-01-07 03:24:16
问题 I want to set menu flyout background either in c# or xaml. I want like this <FlyoutBase.AttachedFlyout> <MenuFlyout x:Name="Flyout"> <MenuFlyout.Items > <MenuFlyoutItem Text="Add Expense" Click="AddExpense_Click"/> <MenuFlyoutItem Text="Add Friends" Click="AddFriends_Click"/> </MenuFlyout.Items> </MenuFlyout> </FlyoutBase.AttachedFlyout> ... And this is my xaml code for menu fly-out 回答1: For your requirement, you could custom MenuFlyoutPresenterStyle like the following <MenuFlyout x:Name=

How to avoid repeating blocks of XAML in a menu

我的未来我决定 提交于 2021-01-07 03:24:16
问题 I have to create a menu. It has 10 entries and they differ by one parameter. Entry 1: <MenuItem Visibility="{Binding MenuSelected.Type, Converter={StaticResource TypeToVisibilityConverter}, ConverterParameter='PAZ', Mode=OneWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <i:InvokeCommandAction Command="{Binding CmdContextMenu}" CommandParameter="PAZ" /> </i:EventTrigger> </i:Interaction.Triggers> <MenuItem.Header> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width=

How to avoid repeating blocks of XAML in a menu

烈酒焚心 提交于 2021-01-07 03:23:16
问题 I have to create a menu. It has 10 entries and they differ by one parameter. Entry 1: <MenuItem Visibility="{Binding MenuSelected.Type, Converter={StaticResource TypeToVisibilityConverter}, ConverterParameter='PAZ', Mode=OneWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <i:InvokeCommandAction Command="{Binding CmdContextMenu}" CommandParameter="PAZ" /> </i:EventTrigger> </i:Interaction.Triggers> <MenuItem.Header> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width=