Modifying FullScreen Design for ListPicker - xaml

I've Been working with WP7 for a while, am using listPicker/DatePicker Heavily. i hate its design though.i use liskPicker's property ExpansionMode="FullScreenOnly". i tried to make those controls to look prettier by
// Setting A source to the FullModeItemTemplate
FullModeItemTemplate="{StaticResource lpkFullItemTemplate}"
//the definition for this Resource is as follows:
<DataTemplate x:Name="lpkFullItemTemplate">
<StackPanel Orientation="Horizontal" Margin="5 5 5 5" Background="#FFA3A3A3"
Width="475" Height="45" >
<TextBlock Text="{Binding}" Foreground="Black" Margin="5 5 15 5" />
</StackPanel>
</DataTemplate>
I need real changes, changing the background of that popup and such changes, is that possible? or i need to build my own popup from scratch?

In order to do that you will have to create a copy of the ListPickerPage.xaml file from the Silverlight for Windows Phone Toolkit in your application, change it to meet your requirements, and then on your ListPicker control set the PickerPageUri proprety to the new ListPickerPage.xaml

I would like to improve Pedro's answer, but I still can't comment. You can see there's some people making questions up there.
In order to copy the ListPickerPage you'll need both the ListPickerPage.xaml and ListPickerPage.xaml.cs files. If you want those files to compile, you need some extension methods defined on Extensions.cs, ItemsControlExtensions.cs and VisualTreeExtensions.cs. You can either copy those three files or cherry pick the methods you need and add them to your own file.

Related

How can i use static resources in WinUI3 pages?

In my last years release i used net core 3 and WPF like that:
<Label Content="{x:Static p:Resources.WJAJobtitle}" VerticalAlignment="Center"/>
Now i'm trying to upgrade to net 5 with WinUI3. As far as i read, i have to use now TextBlock instead of Label. I read the docs, but haven't found anything about static resources.
Maybe anyone knows, how to set it correctly?
As found there the new format for such things are:
<TextBlock x:Uid="WJAJobtitle"/>

Xamarin Hot Reload does... Absolutely Nothing when Changes are Made

I'm creating a very UI centric application - in this application it is important (or event vital one can say) that I can actively preview my changes. Thankfully, Xamarin.Forms has Hot Reload - the perfect tool to get started to preview your changes!
I enabled hot reload in the 'Hot Reload' section in the options tab - I also enabled the 'Changes Made' (which is in preview) option to 'ON'.
I started my application - and I changed the text of a button... And...
Nothing.
I closed and reopened my app - and tried again... And... guess what?
Nothing.
Xamarin.Forms - come on!
This is a very annoying issue I've had on this specific application - it's taken away most of my day and I've just been fighting and fighting - and I have been unable to solve anything.
What I tried to do:
I tried to upgrade my Xamarin.Forms version to the latest - and that still did not solve anything.
I tried to enable and disable Hot Reload from the options menu - and that still did not solve anything.
I tried to close and reopen the solution - clean - and build - and you guess it: still I could not preview my changes.
I checked if I enabled it and it was enabled.
I checked my linker settings and they were as expected.
Images:
XAML code:
I changed the background color to blue:
<Grid HeightRequest="100"
Margin="5"
BackgroundColor="White"
RowSpacing="2">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="125" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0"
Grid.Column="1"
TextColor="Blue"
VerticalOptions="Center"
Text="{Binding EventTitle}"
Margin="7"
Padding="10,0" />
<Image Grid.Row="0"
HeightRequest="125"
VerticalOptions="Start"
Margin="2,2,1,2"
Aspect="AspectFill"
Source="{Binding Image}" />
</Grid>
My phone:
Even after saving - and waiting for at least half an hour - still the background is white.
I've tried everything possible to get it to work and I've been hitting the wall each time.
I am looking for help,
Thanks,
Tom
I've had all sorts of different issues with Hot Reload not working over the past few months.
I found the only consistent way that I could get it to work was by opening the project the long way around.
So:
Open Visual Studio
Choose Continue without code on the startup screen
Go to File -> Open -> Project/Solution and choose the solution from there.
Whenever I load the project this way, Hot Reload will work. If I load it any other way, it seems to be really temperamental.
Open project
Go to Tools => Debugging => Hot Reload
On "Common" section tick "Apply XAML hot reload on document save"
on "Xamarin.Forms" section tick "Full Page"
as shown in the image (red circled below).
On a project had the same issue , found out that i have to be in a XAML page
and not a XAML.CS page
Then hit save and it starts again and oke.
Common options - only Enable Just My XAML in Live Visual Tree
And in Xamarin.Forms option -Full page
ps
On your example it is White
BackgroundColor="White"

How can I get information about X:bind from code?

In universal windows apps, a new form of binding is available. Lets use this example:
<TextBox Text="{x:Bind TextContent, Mode=TwoWay}"/>
where TextContent is a simple dependency property in the same user control / or the same page. Now, the xaml compiler generates the binding by creating some .cs files in the output directory.
As the bininding is compiled into the resulting application, I want to know if there is there a way to gather information about the binding from code? Specifically, I'd like to get the property path (TextContent in this example) from my own code.

Windows Phone 8.1 xaml - read language resources from external project

I have portable library in which I have AppLocalizations.resw resource files. I can read it in the code behind (which is obsolete, but working):
new Windows.ApplicationModel.Resources.ResourceLoader("Assembly/AppLocalizations")
But how can I use it from the xaml? When I try to read it this way, the text is blank, even if the key in the resource file is Key.Text
<TextBlock x:Uid="Key" />
I was triying to import it in the App.xaml, but with no success.
Thanks.
I use this code with Windows Phone Universal Apps, but with a general resources:
<TextBlock Style="{StaticResource TextBlock_BlackStyle}" x:Uid="/Resources/txtIPName" Name="txtIPName" HorizontalAlignment="Left" Margin="33,149,0,0" TextWrapping="Wrap" Text="IP:" VerticalAlignment="Top"/>
Then if u had exertanl library, I think the code is:
<TextBlock x:Uid="/Assembly/AppLocalizations/Key" />
Tell me if I solve your problem! Good luck man! :)

Unknown type 'AppBarButton' in XML namespace - Windows 8 Store App XAML, issues adding app bars

I'm new to developing Windows 8 apps, and am having trouble getting my XAML file to recognise generated code for adding AppBars and CommandBars.
I am getting the error "Unknown type [something] in XML namespace" for a number of elements I am trying to add, here is my example below:
If I re-open my solution this is temporarily displayed as a warning rather than an error. Also navigating to http://schemas.microsoft.com/winfx/2006/xaml/presentation just produces "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.".
This is all default code. my class namespace (e.g. MyApp.MainPage) matches the MainPage code behind namespace. I am at a loss and have been battling this for hours. I also intermittently changes from this error to 'InitializeComponent' does not exist in the current context". I have spent hours on XAML permissions errors in the past few days and don't want to waste any more time with errors in default generated code! :(
EDIT: I have tried this on three different machines, using both Windows 8 and Windows 8.1, both new projects and the existing project I have described in this post.
My guess is that you are using Visual Studio 2012 (Windows 8 apps). If so, you should use Button:
<Page.TopAppBar>
<AppBar>
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource AppBarButtonStyle}">A</Button>
<Button Style="{StaticResource AppBarButtonStyle}">B</Button>
</StackPanel>
</AppBar>
</Page.TopAppBar>
To use AppBarButton, you must use Visual Studio 2013 (Windows 8.1 apps):
<Page.TopAppBar>
<AppBar>
<StackPanel Orientation="Horizontal">
<AppBarButton>
<AppBarButton.Icon>
<FontIcon Glyph="A"/>
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton>
<AppBarButton.Icon>
<FontIcon Glyph="B"/>
</AppBarButton.Icon>
</AppBarButton>
</StackPanel>
</AppBar>
</Page.TopAppBar>
Also, CommandBars are only available in Windows 8.1.