How can I stretch my custom ListBox?

I have this ListBox with custom elements and I want them to stretch to take all the available area. This is my code; currently the items only take the space that they need and I have some unused space on the left and the right side of the screen. Why?<ListBox x:Name="listBox" Margin="0,6,0,0"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> </Style> </ListBox.ItemContainerStyle> &l...

convert temperature from decimal to whole using xamarin forms

just curious how will I define the following in forms.c# weather.Temperature = (string)results["main"]["temp"] ;xaml<Label x:Name="tempLabel" Text="{Binding Temperature , StringFormat='{0}°'F}"/> my current result : 270.50 it should be 83 FAny ideas? Thanks Disragarding the conversion °F<->°C you can use the format string to display whole numbers only<Label x:Name="tempLabel" Text="{Binding Temperature , StringFormat='{0:F0}°F'}"/> (please note, that I moved the 'F' within the quotation marks in order to be displayed correct...

XAML - MenuFlyoutItem attached to a ListView doesn't work in WP8.1

I develop an Universal app that uses the MVVM-Lght toolkit.On a page, I show a list of comments. I would like that an user could add a new comment, and edit or delete its existing comments.For adding new comment, I use an AppBarButton on the CommandBar and it works fine.For editing and deleting the existing comments, I would like to display a MenuFlyout that offers 2 items: "edit" and "delete". I can display the MenuFlyout but nothing happens when I click on its items...Here is my concerned xaml code: <ListView x:Name="myCommentaires" ItemsSource="{Bindi...

How to Use Microsoft XAML Border on Xamarin Forms

I want to know what would be a XAML windows phone "Border" to Xamarin Forms? there's no Border to use BorderThickness, i want to draw some "lines" and set inside of 5 row's.ThanksXAML Windows Phone :<Border Grid.Row="0" BorderThickness="0,0,0,2" BorderBrush="#fe98fe"/>I found a Frame on xamarin it does almost the same thing as Border but is not looking good for me! If you just want to draw a Line, you can use the BoxView https://developer.xamarin.com/api/type/Xamarin.Forms.BoxView/ Example for a horizontal line with height 2:<BoxView Color="Red" HeightRequest="2...

Nested Grouped ListView in XAML

I'm making a chatting app like WhatsApp. This is the layout I want to make,Me(Static HeaderText)MyInformation(Profile Image and name)Favorites(Static HeaderText)My Favorite friend information(Profile Image and name)My Favorite friendFriends(Static HeaderText)AMy friend information(His name starts with A)My friendBMy friendI implemented this with 3 listviews(Me, favorites, friends) in the Grid.<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <Grid.Resources> <CollectionViewSource x:Name="CollectionGroupedView" IsSourceGrouped="...

Xamarin forms Horizontal listview showing images from ObservableCollection

I want to display Images/Thumbnails of photos that I've been taking in a horizontal view as a part of my content page.I've stored the images paths as strings in a ObservableCollection. What's the best approach to do this in XAML and PCL.Would be great if 3 or something images are shown on the screen, and standard image if no images have been added or if string is null, and to have these in a scrollview or listview so that all of the images in the ObservableCollection could be displayed.maybe something like this/Oliver Use Bindable (Horizontal) Scroll View. see this link ...

Cannot navigate to another page

I have a button and a tapped event:private void btnSetLocationName_Click_1(object sender, RoutedEventArgs e) { ApplicationModel.LocationName = locationName.Text; Frame.Navigate(typeof(GroupsPage)); }I want to just navigate to another page. Unfortunately, Frame.Navigate does not work. I have also tried to make sure it runs in the GUI thread: await this.Dispatcher.RunAsync(CoreDispatcherPriority.High, () => Frame.Navigate(typeof(GroupsPage)));However, it should do, as the click handler for the button runs in the GUI thread.The following error...

Xaml two way binding of textbox to observable collection

In my WP8 app I have a class, which has a ObservableCollection<ObservableCollection<int>> property called Matrix.I want to display these matrices using items control. <ItemsControl ItemsSource="{Binding FirstMatrix.Matrix}"> <ItemsControl.ItemTemplate> <DataTemplate> <ItemsControl ItemsSource="{Binding}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"></Stac...

Can't use Flyout in the Button in WinRT?

While using the Flyout in the Button as mentioned in the below code snippet, <Button HorizontalAlignment="Center" Content="Open Flyout"> <Button.Flyout> <Flyout> //some code </Flyout> </Button.Flyout> </Button>It throws the following errors while building the app:Unknown type 'Flyout' in XML namespacehttp://schemas.microsoft.com/winfx/2006/xaml/presentation' Unknown member 'Flyout' on element 'Button'Note : It worked fine previously (a month before)Vs2012 - Windows8.1What am i missing? any help will b...

Does a large XAML cause the push navigation of a xamarin forms page to slow down?

Does a large XAML cause the push navigation of a Xamarin forms page to slow down? Also do static resources included from app.xaml play a part? What can be done to improve the navigation speed? may be. if its an huge issue. thenmake a pure code-behind version - https://forums.xamarin.com/discussion/48200/is-there-a-way-to-speed-up-xaml-page-loadingTry Fast Renderers - https://developer.xamarin.com/guides/xamarin-forms/under-the-hood/fast-renderers/ [XXX]

Strech ListBox/ItemsControl in UWP

I want to stretch a listbox horizontally and vertically in UWP. I tried some WPF solutions, but none of them worked. (Stretch line to width of Itemstemplate canvas in itemscontrol)What I tried:<Page.Content> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <ListBox VerticalContentAlignment="Stretch" VerticalAlignment="Stretch" Background="Green"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stret...

Appbar Button icon image seems not correct in Window 8.1

I created an appbar button using BitMapIcon. Below is the code <AppBarButton HorizontalAlignment="Stretch" Label="AppBarButton" VerticalAlignment="Stretch" Background="White" Foreground="White"> <AppBarButton.Icon> <BitmapIcon UriSource="Assets/work.png"/> </AppBarButton.Icon></AppBarButton>Where work.png is the button image. But appbar button image seems different that of the original work image. See the Images The second image is the original icon of 40 x 40 size image & i put background as black for display purpose [work....

User Control Animation Only Works On Last Declared Control Instance

I am proto-typing a (Windows 10 universal app) UI and have built a very simple/rough user control to act as a 'badge', i.e show a numeric value in a circle, and animate the value changing. My issue is the control works if there is only a single instance of it in an application page. If there are multiple instances (even if the other instances are invisible), then only the last declared instance animates.I've tried declaring the animation both in the user control's XAML, and in code behind to attempt to ensure there's no cross-over/mix up with the animation being shared. I a...

XAML - get user control position relative to whole window as binding property

I'm new to XAML, so please be aware my question may contain some topic misundrestanding.Is it posible to bind XAML usercontrol global (relative to window) position to check if it's currently visible on screen? Usercontrol is inserted inside ScrollViewer and I think on something like: <UserControl x:Class="Test.MessageControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="300"> <StackPanel > <Label Name="LabelTest" Content="{Binding Relativ...

Sharing VisualStateGroups between styles

I have the following xaml<Style x:Key="GridStyle" TargetType="Grid"> <Setter Property="VisualStateManager.VisualStateGroups"> <Setter.Value> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"/> <VisualState x:Name="PointerOver"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="BorderBrush"> <DiscreteObjectKeyFrame KeyTime="0"...

Image flickers in ListView datatemplate

could someone tell me, how can I avoid image flickering in Datatemplate? Everytime I change the source through binding (MVVM pattern), the image in ListViewItem flickers. For other images in app I've used ImageOpened event in code-behind. But I can't be used when I have DataTemplate.EDIT:DataTemplate:<DataTemplate x:Key="ContactItemDataTemplate" x:DataType="contactData:Contact"> <Grid MinHeight="48"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="Auto" /> ...

Page 1 of 83  |  Show More Pages:  Top Prev Next Last