How hide info from my custom text box? (Windows Phone) - c#

In my Windows Phone Application I have a login Page. When I put some text into Pass TextBox, the data should be hide with this symbols: "*". How can I hide info from my custom text box?
<ValidationControl:ValidationControl x:Name="txtPIN" GotFocus="PinTextBox_GotFocus" Margin="0,0,45,0" TextWrapping="Wrap" ValidationContent="Please insert a valid id" LostFocus="PinBoxLostFocus" InputScope="Number" HorizontalAlignment="Right" Width="200" MinWidth="220" MinHeight="80" MaxLength="4" Foreground="Black" Background="#DEFFFFFF" ValidationRule="{StaticResource pinValidationRule}" TextChanged="txtPIN_TextChanged">
<ValidationControl:ValidationControl.ValidationSymbol>
<Image Source="img.png" Height="40" Width="40" />
</ValidationControl:ValidationControl.ValidationSymbol>
</ValidationControl:ValidationControl>
UPDATE
<ValidationControl:ValidationControl x:Name="txtPIN" GotFocus="PinTextBox_GotFocus" Margin="0,0,45,0" TextWrapping="Wrap" ValidationContent="Please insert a valid id" LostFocus="PinBoxLostFocus" InputScope="Password" HorizontalAlignment="Right" Width="200" MinWidth="220" MinHeight="80" MaxLength="4" Foreground="Black" Background="#DEFFFFFF" ValidationRule="{StaticResource pinValidationRule}" TextChanged="txtPIN_TextChanged">
It doesn't work

U can use System.Security.SecureString to keep it encrypted..

System.Security.SecureString is not available on the Windows Phone platform!
Just have a look at the SecureString Class.

Related

Setting background & opacity to button but not affecting it's content

I am working with WPF, and what I want to do is to set opacity and background color of my button but I dont want to affect content inside my button. I tried few ways but unfortunately that did not work.
I found this style and I would like to apply something like that:
This is my numeric keyboard: ( I AM TRYING TO EDIT BTN 7) :
As you can see guys, unfortunately I could not set opacity of my button without affecting the content inside.
Here is my XAML code (focus on btn 7):
<StackPanel Height="50" Orientation="Horizontal" Margin="0,0,0,5">
<Button FontSize="15" FontWeight="Bold" x:Name="btn7" Foreground="#83D744" Click="btn7_Click" BorderBrush="#83D744" BorderThickness="0.5" Content="7" Width="80" RenderTransformOrigin="0.557,0.693" d:LayoutOverrides="HorizontalAlignment" Background="Black" Opacity="0.2" Margin="0,0,5,0" />
<Button FontSize="15" Foreground="Black" FontWeight="Bold" x:Name="btn8" Click="btn8_Click" Content="8" Width="80" Background="#FF50504F" Margin="0,0,5,0"/>
<Button FontSize="15" Foreground="Black" FontWeight="Bold" x:Name="btn9" Click="btn9_Click" Content="9" Width="80" d:LayoutOverrides="HorizontalAlignment" Background="#FF50504F"/>
</StackPanel>
So could anyone help me please how to solve this thing..
Thanks!
add transparency to a brush used for Background
hex code for Black color is #000000
change alpha channel to make it semi-transparent (Background="#50000000") and remove Opacity="0.2"
<Button x:Name="btn7"
FontSize="15" FontWeight="Bold" Foreground="#83D744"
Click="btn7_Click"
BorderBrush="#83D744" BorderThickness="0.5"
Content="7" Width="80" RenderTransformOrigin="0.557,0.693"
d:LayoutOverrides="HorizontalAlignment"
Background="#50000000" Margin="0,0,5,0" />
Make the opacity of the button 0.2 to 1

Button with flyout change apperance of other buttons when clicked - Windows 8.1

In a windows 8.1 project i have the following button with a flyout.
<Button x:Name="FilterCompanyMeetings2" Foreground="White" Content="Company Meetings" Margin="15,58,0,0" Height="40" VerticalAlignment="Top" Style="{StaticResource ButtonStyle2}">
<Button.Flyout>
<Flyout>
<StackPanel Width="406">
<TextBlock Text="Insert the value and tap the Send button:" FontSize="16"
FontWeight="SemiLight" FontFamily="Segoe UI"
Margin="0,0,0,10" />
<TextBox x:Name="ValueTextBox" />
<Button Content="Send" HorizontalAlignment="Right"
FontSize="16" Margin="0,10,0,0" />
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
Im having a issue when i press the button, the flyout appears as expected but all other buttons change their background to a gray color and some of them change their foreground to black.
I dont use this button for anything at the moment, but when i press it that happens.
Why does it change style of other button on the page?

i want to replace these textbox with place holder text in textbox in wpf

In my project is having the below code for textbox i want to replace these textbox with place holder text in textbox in wpf.
<TextBox Grid.Column="0" MaxLength="1000" TextWrapping="Wrap" AcceptsReturn="True"
Grid.Row="1"
Margin="5,0,0,5" Height="100"
Text="{Binding QuestionText, UpdateSourceTrigger=LostFocus}" />
I didnt get the language but hopefully you wanted to bind it this way
<TextBox Grid.Column="0" MaxLength="1000" TextWrapping="Wrap" AcceptsReturn="True"
Grid.Row="1"
Margin="5,0,0,5" Height="100"
PlaceholderText="{Binding QuestionText, UpdateSourceTrigger=LostFocus}" />
what you can do is either extend the TextBox control on your own or use what worked for me:
Watermark TextBox
read the instructions at the link and implement accordingly

Property error in Windows phone development in C# and XAML

This is a Water Hackathon, 2014 Project.
I am a newbie in windows phone. I was developing an app for a project. part of the app is that user will write his number and some text and the number and text will be emailed to a particular person.
I used drag n drop UI and wrote the code of email send in Visual C#. Here is the error:
Failed to assign to property 'System.Windows.UIElement.AllowDrop'.[Line: 53 Position: 76]
at
System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at
PhoneApp2.MainPage.InitializeComponent()
at PhoneApp2.MainPage..ctor()
part of the C# code:
private void emailSend(object sender, RoutedEventArgs e)
{
// Create a new instance of the class EmailComposeTask with which you can send email
var emailcomposer = new EmailComposeTask
{
// I enter the recipients to send the email using the To property of the class
EmailComposeTask
To = string.Concat("mailto:","ibtehaz.shawon#gmail.com"),
// Set the title of the property by Subject
Subject = "number",
// Enhanced the value of the Body property EmailComposeTask class, this is the
content that will display the recipient
Body = bigText.Text,
};
// Start the email application on your device to send the Email
emailcomposer.Show();
}
part of the XAML file:
<TextBlock Text="Wheres the problem" Style="{StaticResource PhoneTextNormalStyle}"
FontSize="36" FontFamily="Andalus"/>
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="10,0,14,0"
RenderTransformOrigin="0.463,0.232">
<TextBox Name="number" HorizontalAlignment="Left" Height="88" Margin="0,98,0,0"
TextWrapping="Wrap" Text="Please enter your phone number" VerticalAlignment="Top"
Width="456"/>
<TextBlock Name="bigText" HorizontalAlignment="Left" AllowDrop="True" TextWrapping="Wrap"
Text="Users will write their problem in here." VerticalAlignment="Top"
Margin="0,231,0,0" Height="414" Width="456" Foreground="White"/>
</Grid>
<Button Name="sendButton" Content="Send your problem" HorizontalAlignment="Stretch"
VerticalAlignment="Top" Margin="10,658,0,0" Grid.Row="1" BorderBrush="#FF996D6D"
Background="#FF081359"/>
Thank you in advance.
You need to replace TextBlock. TextBlock is only used for displaying text, so you can't edit it (eg, drop text onto it). TextBox allows input and will let you drop text into it.
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="10,0,14,0"
RenderTransformOrigin="0.463,0.232">
<TextBox Name="number" HorizontalAlignment="Left" Height="88" Margin="0,98,0,0"
TextWrapping="Wrap" Text="Please enter your phone number" VerticalAlignment="Top"
Width="456"/>
<TextBox Name="bigText" HorizontalAlignment="Left" AllowDrop="True" TextWrapping="Wrap"
Text="Users will write their problem in here." VerticalAlignment="Top"
Margin="0,231,0,0" Height="414" Width="456" Foreground="White"/>
</Grid>
<Button Name="sendButton" Content="Send your problem" HorizontalAlignment="Stretch"
VerticalAlignment="Top" Margin="10,658,0,0" Grid.Row="1" BorderBrush="#FF996D6D"
Background="#FF081359"/>

How can I fake my own in App Tiles in Windows Phone

I am considering my Launch Screen/Dashboard screen having tiles(Squares with a few lines of information on them). I understand that tiles are not a UI object for use inside Windows Phone apps, but I've seen some people fake them somehow.
Can anybody gimme and some tips and guidance as to how this is achieved? I am under the impression of what I have seen in my first 2 days working on Win-Mobile that you cannot stack view objects on top of each other. For example drawing a square object and then drawing 3 lines of text on top of that to make a tile.
Many Thanks,
-Code
Was it the HubTile control you saw?
Here is what I am doing for my Dashboard page in my application. It is simply a StackPanel with two TextBlocks inside. These StackPanels are then inside of a WrapPanel from the Silverlight Toolkit for Windows Phone inside of a ListBox, which you don't have to use.
<ListBox Name="lstTiles" Margin="0,0,-12,0">
<ListBoxItem>
<StackPanel Background="{StaticResource PhoneAccentBrush}" Width="173" Height="173" Margin="12,12,0,0" Tap="stkSignIn_Tap">
<TextBlock Text="Tile Title" Style="{StaticResource PhoneTextTitle2Style}" Foreground="White" TextWrapping="Wrap" Margin="12,6,12,12" Height="106" />
<TextBlock Text="Your subtitle here" Style="{StaticResource PhoneTextNormalStyle}" Foreground="White" Margin="12,12,12,12" VerticalAlignment="Bottom" />
</StackPanel>
</ListBoxItem>
<ListBoxItem>
<StackPanel Background="{StaticResource PhoneAccentBrush}" Width="173" Height="173" Margin="12,12,0,0" Tap="stkSignIn_Tap">
<TextBlock Text="Tile Title" Style="{StaticResource PhoneTextTitle2Style}" Foreground="White" TextWrapping="Wrap" Margin="12,6,12,12" Height="106" />
<TextBlock Text="Your subtitle here" Style="{StaticResource PhoneTextNormalStyle}" Foreground="White" Margin="12,12,12,12" VerticalAlignment="Bottom" />
</StackPanel>
</ListBoxItem>
<ListBoxItem>
<StackPanel Background="{StaticResource PhoneAccentBrush}" Width="173" Height="173" Margin="12,12,0,0" Tap="stkSignIn_Tap">
<TextBlock Text="Tile Title" Style="{StaticResource PhoneTextTitle2Style}" Foreground="White" TextWrapping="Wrap" Margin="12,6,12,12" Height="106" />
<TextBlock Text="Your subtitle here" Style="{StaticResource PhoneTextNormalStyle}" Foreground="White" Margin="12,12,12,12" VerticalAlignment="Bottom" />
</StackPanel>
</ListBoxItem>
</ListBox>
The Telerik RADHubTile control can do this for you. Please, check out this article:
New Hub Tile Control for Your Windows Phone Apps
Note: the library cost around $99 I think.
There are many tile controls available now, but for the sake of anyone else going in search of one, you can find my pretty simple 'home grown' tile control here: http://www.crisrowlands.com/wpdev-tips-4/

Categories