WP8: no popup available? - popup

I'd like to programm a tiny popup to get some user input (a textarea, a input field and two buttons). What component could host these components? Apparently there is no Popup class?

This is one basic popup
<Popup Name="m_Popup" IsOpen="False" Opened="OnPoputOpen" Closed="OnPopupClose" >
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height ="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<TextBox Name="m_TextBox" Grid.Row="0"/>
<Button Name="m_Button1" Grid.Row="1"/>
<Button Name="m_Button2" Grid.Row="2"/>
</Grid>
</Popup>
You control the visibility with IsOpen. Here is a link to Popup Class
Good luck (:

No, this is not provided in the SDK. You have to build it yourself.

Related

Setting size of editor for chat UI in .NET MAUI app

In my .NET MAUI app, I'm implementing chat feature and want to make sure that the Editor and Button are perfectly located at the bottom of the screen.
I created a Grid for the controls to produce this layout
The problem I'm having is with the Editor width because if I get it to look right on Android, it's not perfect on iOS and vice versa.
Here's how I approached it:
<Grid
RowDefinitions="50"
ColumnDefinitions="*,50"
RowSpacing="0"
ColumnSpacing="5"
HorizontalOptions="StartAndExpand"
Margin="5,5,5,5">
<Editor
Grid.Column="0" />
<Button
Grid.Column="1" />
</Grid>
Other than entering some arbitrary number for WidthRequest for the Editor, how do I set the width for it so that it always takes up all the available space and look like it in the picture?
After setting HorizontalOptions="FillAndExpand" as Jason suggested like below, it looks right on Android and iOS.
<Grid
RowDefinitions="50"
ColumnDefinitions="*,50"
RowSpacing="0"
ColumnSpacing="5"
HorizontalOptions="FillAndExpand"
Margin="5">
<Editor
Grid.Column="0" />
<Button
Grid.Column="1" />
</Grid>

How can I add an extra label/slide button to a FlyoutItem in MAUI?

I encountered an UI issue when developing an app using MAUI flyoutItem. According to the official doc, it looks like I can only define the flyoutItem appearance by setting two columns(https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/flyout?view=net-maui-7.0): one bind to FlyoutIcon and the other bind to Title.
What if I want to add a third item such as a label for identity/status or a slide button to enable/disable? I expect sth look like this:
[column 0]FlyoutIcon [column 1]Label1 [column 2]Label2/Slide Button
Can you please also show me some sample code for the solution?
Best and Regards
I tried to modify the Grid to add a third column and addition Label but seems not working.
<Shell ...>
...
<Shell.ItemTemplate>
<DataTemplate>
<Grid ColumnDefinitions="0.2*,0.4*,0.4*">
<Image Source="{Binding FlyoutIcon}"
Margin="5"
HeightRequest="45" />
<Label Grid.Column="1"
Text="{Binding Title}"
FontAttributes="Italic"
VerticalTextAlignment="Center" />
<Label Grid.Column="2"
Text="{Binding Text}"
FontAttributes="Italic"
VerticalTextAlignment="End" />
</Grid>
</DataTemplate>
</Shell.ItemTemplate>
</Shell>
Er, guys. Looks like using Menu Item instead of FlyoutItem will resolve the issue.

ControlTemplate Content Not Resizing

I am trying to achieve a templated view on my pages which displays a standard header and footer where my content goes in the middle. To achieve this I decided to use a ControlTemplate and reference this on each page.
In my resource dictionary I have the following:
<ControlTemplate x:Key="MoneyTemplate">
<Grid
VerticalOptions="FillAndExpand"
BackgroundColor="{DynamicResource BackgroundColor}"
Padding="25">
<Grid.RowDefinitions>
<RowDefinition Height="100" />
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Image
Grid.Row="0"
Source="buddy.png" />
<tabView:SfTabView
Grid.Row="1"
VerticalOptions="CenterAndExpand"
TabBarPlacement="Bottom">
<tabView:SfTabItem Header="Overview" TextColor="Black">
<ContentPresenter />
</tabView:SfTabItem>
<tabView:SfTabItem Header="Scheduler">
<Label Text="Hello world" />
</tabView:SfTabItem>
</tabView:SfTabView>
<Label
Grid.Row="2"
Text="Hello" />
</Grid>
</ControlTemplate>
And on my pages I implement with:
<ContentView
VerticalOptions="Fill"
ControlTemplate="{StaticResource MoneyTemplate}">PAGE CONTENT GOES HERE</ContentView>
When I implement this in a Windows application and resize my window the control does not update, however if I stop using a ControlTemplate and paste this xaml directly into the page everything renders correctly.
I realise that MAUI is still in preview but I'm unsure of whether the problem is the way I've written the template and whether my understanding is off or whether this is a bug within MAUI.

Scrolling of GridView on Windows Store Apps

I have the following design concept for a Windows Store App, but I'm stuck at the best way to implement this:
The red rectangle indicates the view of the page on an actual device. The page consist of a header Grid on the left, and a GridView on the right. What I want to achieve is, when the user performs a swipe gesture, instead of scrolling on the GridView, I hope that the entire page is scrolled, just like this:
I have managed to achieve this by using the following method:
<ScrollViewer HorizontalScrollMode="Enabled">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="600" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid x:Name="LeftHeaderPanel" />
<GridView Grid.Column="1" ScrollViewer.HorizontalScrollMode="Disabled" ScrollViewer.VerticalScrollMode="Disabled" />
</Grid>
</ScrollViewer>
However, for some reason unknown to me, the GridViewItems within the GridView are displayed like a StackPanel after I set it this way, which means that the items no longer stack horizontally -- instead they now stacked vertically.
I have also discovered that by setting the Height attribute on the GridView control will solve the problem, but I'm trying to avoid the need to explicitly specify the height of my control. Is there any way out? Thanks!
Try this : below code works for me
Use HorizontalScrollBarVisibility and VerticalScrollBarVisibility instead of HorizontalScrollMode VerticalScrollMode
<ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="600" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid x:Name="LeftHeaderPanel" />
<GridView Grid.Column="1" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
</Grid>
</ScrollViewer>

Xaml grid image gallery with preview

I would like to create an image gallery in my win8 app where the user can select a thumbnail image and preview it in a larger area. I am obtaining the images from Facebook and using data binding to a grid view for the thumbnails. However, I cannot seem to find how to allow the user to select the image and display a large version of the image in a separate area.
Basically I want to set the source of the rectangle/area to the source url of the selected thumbnail. Is this possible?
So far I've got the following but the view box doesn't display anything:
<GridView x:Name="photosView" ItemsSource="{Binding Photos}" HorizontalAlignment="Left" Margin="762,462,0,0" Grid.Row="1" VerticalAlignment="Top" Width="514" Height="166" ItemTemplate="{StaticResource picTemp}" IsItemClickEnabled="True">
<GridView.DataContext>
<ViewModel:FacebookPhotosData/>
</GridView.DataContext>
</GridView>
<Viewbox x:Name="Preview" HorizontalAlignment="Left" Height="379" Margin="778,48,0,0" Grid.Row="1" VerticalAlignment="Top" Width="480">
<Viewbox.DataContext>
<ViewModel:FacebookPhotosData/>
</Viewbox.DataContext>
</Viewbox>
I solved it myself. I used an image and the ItemClicked event to change the source.
<GridView x:Name="photosView" ItemsSource="{Binding Photos}" HorizontalAlignment="Left" Margin="762,462,0,0" Grid.Row="1" VerticalAlignment="Top" Width="514" Height="166" ItemTemplate="{StaticResource picTemp}" IsItemClickEnabled="True" ItemClick="photosView_ItemClick">
<GridView.DataContext>
<ViewModel:FacebookPhotosData/>
</GridView.DataContext>
</GridView>
<Image x:Name="Preview" HorizontalAlignment="Center" Height="379" Margin="778,48,0,0" Grid.Row="1" VerticalAlignment="Center" Width="480"/>
In the event handler, I set the image to show the picture indicated by the URI in the selected image.