xaml

Prefix DataGridComboBoxColumn items with string

人走茶凉 提交于 2021-01-29 16:32:09
问题 I have a DataGridComboBoxColumn which contains a ComboBox of enums (in this instance F1, F2, F3). I want to prefix each item in that ComboBox with a string - in this instance "SHIFT + ", so that the ComboBox displays strings such as "SHIFT + F1", "SHIFT + F2" etc. Is there a way to do this? I've tried using an IValueConverter and whilst the code executes correctly and breaks on the return value of the converter, the values are not displayed in the ComboBox: XAML DataGridComboBoxColumn Header=

Binding from UI to view model property requires focus to be removed from the TextBox

孤人 提交于 2021-01-29 12:50:49
问题 I am using MVVM. I have a DataGrid which lists some airports. Now I have a textbox let the user to input some keywords to search for a particular airport so that the airport list will only display matched airports. private string airport; public string Airport { get { return airport; } //the following will not be executed unless the cursor is removed from the textbox set { airport = value; //OnPropertyChanged("Airport"); } } view: <TextBox x:Name="textBox_Airport" Text="{Binding Airport}"> <i

Referencing MainWindow's content in MaterialDesign's DialogHost

荒凉一梦 提交于 2021-01-29 11:17:02
问题 I'm developing a WPF application using Material Design in XAML library. I'd like to use a dialog box to display error messages. In the documentation I've read that in order to dimm and disable content behind the dialog box I have to put it in the DialogHost tag, right after DialogHost.DialogContent This is what I have right now: <Window> <md:DialogHost> <md:DialogHost.DialogContent> Content of my dialog box </md:DialogHost.DialogContent> My window's content wrapped in grid. </md:DialogHost> <

How to make isTextSearchEnabled property work in case of ComboBox with icons in the beginning of text?

牧云@^-^@ 提交于 2021-01-29 11:11:49
问题 In a ComboBox, we can jump to an item by typing its first few letters. This is when IsTextSearchEnabled property is set, which by default is true. I have a custom ComboBox with images in the beginning, followed by a short text. icon1 + Violet icon2 + Red icon3 + Blue If I type "r", I expect to navigate to the Red item in the dropdown. However, because of an icon in the beginning, the IsTextSearchEnabled property does not behave as expected. How can I make this work? For example, in MyDropdown

Saving and reading Picker values from SQLite - Xamarin.Forms

谁说我不能喝 提交于 2021-01-29 11:09:20
问题 I would like you to help me solve a problem that I can not deal with. In my Xamarin.Forms application, the user can add to the SQLite database: public class Car { [PrimaryKey, AutoIncrement] public int ID { get; set; } public string Text { get; set; } public int PickerValue { get; set; } } PickerValue is of type INT because I think that the selected value of the picker gives the index INT value. Am I wrong? The user adds item using: <Editor Placeholder="Enter name" Text="{Binding Text}" />

Auto size ListView height when ListView item gets modified

亡梦爱人 提交于 2021-01-29 09:27:52
问题 I have been having some issues resizing my list view row to match the text inside of it. Also I have read a lot of documentation and everything seems to point toward using HasUnevenRows , which I am using but isn't quite what I need. I have a ListView which I allow the user to modify contents of this row using Rg.Popups and context actions. Essentially the user swipes and clicks Edit and they get pushed to a popup where they can edit the list view item. When the note gets updated it also gets

How to binding property in a behavior?

人盡茶涼 提交于 2021-01-29 08:46:55
问题 I created a behavior to use a phone mask. It is working properly, when the Mask is inserted explicitly. But I would like to communicate with the view model to change the mask, when I change the type of phone in the picker. In xaml file: <Picker x:Name="picker_cadastronotificacao_tipotelefone" Title="{x:Static local:AppResources.picker_cadastronotificacao_tipotelefone}" Style="{StaticResource Picker}" SelectedItem="{Binding TipoTelefoneSelecionado}"> <Picker.Items> <x:String>Celular</x:String>

How to nest Tab views in Xamarin.Forms

空扰寡人 提交于 2021-01-29 08:43:45
问题 I am trying to create this layout in Xamarin XAML but I cannot figure out how to combine TabView within a TabView. I want 3 main tabs in the bottom and for each page 1-2 subtabs. On each subtab I will need to have a ScrollView(I think thats the right element to use) with list items, which makes it even more complex. Like this picture: Any idea or guidance of how to achieve this? 回答1: I am trying to create this layout in Xamarin XAML but I cannot figure out how to combine TabView within a

Drawing image using Blur effects in UWP is not properly set size for the image

风格不统一 提交于 2021-01-29 08:20:51
问题 I want to blur the image using slider. For this, I have used Win2D Blur effects and draw the image in CanvasControl and added the canvas over the actual image. Download sample here Steps. 1. Added CanvasControl in button click. It will add a child to grid over the actual element 2. Change Slider to apply the blur 3. Issue: Image stretched and it's size too large and look like cropped. Not in the given size (500, 400) [XAML] <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="7*"/>

Include Dynamic Custom Xamarin Xaml View Control

南楼画角 提交于 2021-01-29 07:22:41
问题 Hello I have a repeating carousel I've copied for each deparment that I want to consolidate and make into a custom xaml view control. Here is the original carousel view I have copied several times in my page. I want to figure out how to clean this up with something externally from the page. <StackLayout Padding="10"> <Label Text="Human Resources" FontSize="Large" TextColor="#000000"></Label> <CarouselView ItemsSource="{Binding HumanResourcesCollection}" PeekAreaInsets="75" IndicatorView=