Getting Show Password checkbox instead of Reveal Button - xaml

Trying to add a reveal button to a PasswordBox, but instead getting "Show Password" checkbox.
Using following code:
IsPasswordRevealButtonEnabled="True"
Expected result:
http://i.stack.imgur.com/GSeFr.png
Results in emulator:
http://i.stack.imgur.com/1FQl8.png
Full PasswordBox code:
<PasswordBox
Margin="10,5,10,5"
x:Name="PasswordLogin"
Grid.Row="2"
FontSize="{StaticResource TextStyleExtraLargeFontSize}"
VerticalAlignment="Stretch"
IsPasswordRevealButtonEnabled="True"
/>

This is the default behavior in windows phone. In Windows it will show icon in the textbox where as in windows phone it will show checkbox below the password box

Related

How to save a string from a Telerik RadWatermarkTextbox

I have this line of code in my Setup.xaml file:
<telerik:RadWatermarkTextBox Grid.Column="1" Grid.Row="2" x:Name="IMAPServer" WatermarkContent="user.example.com"/>.
When the user clicks on the box they can type the server they're using into it, but I'd like to be able to save the text in this box when they press a button to go to the next page, so I can save the server in a .JSON file. How do I do this? Do I need to create a function in my Setup.xaml.cs and call it in Setup.xaml?
I'm not familiar with that telerik TextBox but for a regular TextBox, you can bind the Text like so:
<TextBox Text="{Binding SomeProperty}" />
Then in your viewmodel class, you have the text saved to the "PropertyOnViewModel" property, which is a string.

wp10:TextBox with flyout not firing lost focus on every got focus

Existing OS version :WinowsPhone 8.1.
Device: Nokia Lumia 925.
XAML code:
<TextBox
x:Name="txtDtpEnd0"
Grid.Row="2"
Grid.Column="0"
Width="130"
Height="30"
Margin="22,0,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
BorderBrush="Gray"
BorderThickness="0.5"
FontFamily="Segoe UI"
FontSize="15"
Foreground="Black"
GotFocus="DeclarativeInlineButton_GotFocus">
<FlyoutBase.AttachedFlyout>
<DatePickerFlyout
x:Name="DtpEnd0"
Title="Select a date"
Closed="datePicker_Closed"
DatePicked="datePicker0_DatePicked" />
</FlyoutBase.AttachedFlyout>
</TextBox>
Code in c# :
private void DeclarativeInlineButton_GotFocus(object sender, RoutedEventArgs e)
{
Windows.UI.ViewManagement.InputPane.GetForCurrentView().TryHide();
TextBox TB = (TextBox)sender;
FlyoutBase.ShowAttachedFlyout(TB);
//Windows.UI.ViewManagement.InputPane.GetForCurrentView().TryShow();
}
Functionality in WP8.1
On focusing of this text box datepicker flyout appear an user can select a date from date picker.
Result In WP8.1
User able to select date and functionality work as expected.
Result In WP10
On focus of textbox softkeyboard appear but sometimes datepicker also appear.
easy Case for soft keyboard : when i hold back button for long and resume to app this and try to focus textbox soft keyboard start appearing. to remove softkeyboard i need to close app and relaunch it.
Conclusion:
But sometimes softkeyboard start appearing without back button hold.
Finally after applying latest windows 10 update(10.0.14393.693) this problem resolved without making any changes in app.

Change ItemSize in ListPicker Windows Phone

I'm new to windows mobile apps.
I have a pivot page and inside that there is multiple pivot items.
Inside the pivot item there is list picker which values are hard coded.
If there is more items in list picker all items show in a new page by default.
My issue is since all the item font are too small when opening the screen.
How can I change the font size of list picker items when those are opening.
My code like this.
<toolkit:ListPicker Grid.Row="0" Grid.Column="2" FontSize="21" Header="" Margin="10,12,-157,12" Background="White" Foreground="Black" BorderThickness="1" >
<sys:String>Convenience Eateries (CE)</sys:String>
<sys:String>Grocery Store (GS)</sys:String>
<sys:String>Secondary Network-ASD</sys:String>
<sys:String>Secondary Network-PSD</sys:String>
<sys:String>Cash and Carry</sys:String>
<sys:String>Modern Trade-Convenience Organized</sys:String>
<sys:String>Modern Trade-Grocery independent(SMMT)</sys:String>
<sys:String>HoReCa-Leisure outlets</sys:String>
<sys:String>HoReCa-Sports Clubs</sys:String>
<sys:String>HoReCa-Night Clubs</sys:String>
<sys:String>HoReCa-Karaoke</sys:String>
<sys:String>HoReCa-Casino</sys:String>
<sys:String>HoReCa-Café and Restaurant/Pubs</sys:String>
<sys:String>HoReCa-Other</sys:String>
<sys:String>Military-Welfare Shop</sys:String>
<sys:String>Military-Canteen</sys:String>
<sys:String>Convenience Mobile Outlets</sys:String>
<sys:String>Unconventional Outlets-Wine Stores</sys:String>
<sys:String>Unconventional Outlets-Other</sys:String>
</toolkit:ListPicker>
Try using ListPickerItem children instead of strings. They should have a better default look than shown above:
<toolkit:ListPicker>
<toolkit:ListPickerItem>Bob</toolkit:ListPickerItem>
<toolkit:ListPickerItem>Betty</toolkit:ListPickerItem>
<toolkit:ListPickerItem>Frank</toolkit:ListPickerItem>
<toolkit:ListPickerItem>Frank</toolkit:ListPickerItem>
</toolkit:ListPicker>
To change how the items look in the full mode page, you need to change the ListPicker's FullModeItemTemplate property. Something like this:
<toolkit:ListPicker>
<toolkit:ListPicker.FullModeItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" FontSize="25" />
</DataTemplate>
</toolkit:ListPicker.FullModeItemTemplate>
<sys:String>Convenience Eateries (CE)</sys:String>
<sys:String>Grocery Store (GS)</sys:String>
<!-- Hard coded values go here, just as in your code. -->
</toolkit:ListPicker>

How to make button bound to ICommand enable/disable when text changes, as opposed to losing focus of TextBox

I have a Windows Store XAML app with a "Save" button, which points to an ICommand property in my ViewModel.
<Button Content="Save"
Command="{Binding DataContext.SaveNewNote, ElementName=grid, Mode=OneWay}"
CommandParameter="{Binding DataContext.CurrentItem, ElementName=grid}" />
on the propertychanged event of my Note model, that fires the CanExecutedChanged event - every time (every keystroke). However, this button will only enable/disable once I leave focus of one of the related textboxes.
In other words, there is a "Name" textbox. If String.IsNullOrWhiteSpace(Name.Text), then CanExecute is set to false. This seems to execute with every keystroke.
I would expect to see this bound Save button enable and disable with each keystroke. HOWEVER, instead, I see the button enable/disable only when I tab out of the textbox.
How can I get this bound button to respect the CanExecuteChanged event on every keystroke, instead of when the texbox loses focus?
The comments by #will and #patrick on the original post both had the correct answer. To do this, you must set the "UpdateSourceTrigger" to "PropertyChanged" and that gives the intended results.
<TextBox Grid.Row="1" PlaceholderText="Enter a short description here"
Text="{Binding NoteAbstract, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}">
</TextBox>

Bing Maps on Windows Store Apps (C#/XAML) display popup when pushpin tapped

I'm using Bing Maps in my Windows Store app, I display some pushpins with some locations on it.
What I want to do is when the user taps on a pushpin, a popup appears with some info related to the location of that push pin. something similar to the popup when the user taps on my location in Microsoft maps application
How can this be done ?
Very easy, you can use the Tapped event of your Pushpin to trigger a popup then use a MapLayer.SetPosition to position your popup see http://msdn.microsoft.com/en-us/library/hh846488.aspx
Like this
currentLocationPushpin.Tapped += Current_location_pushpin_tapped;
then
void Current_location_pushpin_tapped(object sender, TappedRoutedEventArgs e)
{
MapLayer.SetPosition(placesAroundYou,location);
MapLayer.SetPositionAnchor(placesAroundYou, new Point(-200, 40));
BingMap.Children.Add(_mapLayer);
}
Try using a Popup control or fake one like this
You can either use a Popup control (see MSDN documentation here) or toggle visibility of a Border element to fake a Popup using Visibility="Collapsed", try this
<Border Background="#FFC3C2BF" Opacity="50" Margin="38,0,0,376" BorderThickness="1" BorderBrush="Black" CornerRadius="8" HorizontalAlignment="Left" MinWidth="50" Width="126" Height="auto">
<TextBlock x:Name="PushpinText" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="Black" Padding="10,10,10,10" />
</Border>