XAML RadioButton Content string not being displayed at runtime - xaml

My XAML file contains a RadioButton. In the Visual Studio's XAML Designer I can see the display of the Content string for this RadioButton. However, when I run the application, the RadioButton is displayed in the GUI without the Content string "Disble E-mail Alerts from Dashboard". Following is the line in the XAML file which declares the RadioButton:
<RadioButton Height="16" Margin="30,50,0,0" VerticalAlignment="Top" Name="DashboardDisableAlerts" HorizontalAlignment="Left" Width="194">Disble E-mail Alerts from Dashboard</RadioButton>
I will really appreciate any help in helping debug why the Content string is not being displayed in the GUI at runtime.
Thanks

Use a tool like Snoop to examine your visual tree. I suspect the text is there but its foreground color makes it invisible.

Related

Unable to select/copy text in Xamarin.Forms

I am useing the Entry control in vb.net xamarin form which is editable. To avoid any edit I used following code
IsReadOnly="True"
But then I am unable to copy that item after long press.
Please help how can I use that control or any other control which is non-editable but copiable.

Modifying default style of TimePicker and DatePicker controls

I am trying to change the background, pressed state background and color of selected date, time values in ComboBox (that is currently Accent color). The problem is that when I apply the default template available at msdn here and here.
My control changes such that each value in these boxes now have different ComboBox instead of just one. Like in the following image (day, month, year have different ComboBox).
(Image is only for reference)
Also some of the theme resources are missing too like
Foreground="{ThemeResource TimePickerHeaderForegroundThemeBrush}"
Margin="{ThemeResource TimePickerHeaderThemeMargin}"
FontWeight="{ThemeResource TimePickerHeaderThemeFontWeight
This is how my control look like at the moment without styling applied
Here is the code I am using
<DatePicker x:Name="Date_Picker"
Header="Date:"
Background="{StaticResource HotPink}"
Foreground="{StaticResource Gray05}" />
<TimePicker x:Name="Time_Picker"
Header="Time:"
MinuteIncrement="5"
Background="{StaticResource HotPink}"
Foreground="{StaticResource Gray05}"/>
One more issue is that pink background is only visible on DatePicker and not on TimePicker which is very weird.
You should edit the templates of the controls. Open the project in Blend and find the element in the Document Outline. Right-click and select Edit Template > Edit a Copy... (see picture below). This will generate a copy of the default template. From this you can edit the different visual states (which determine how the control will look in different states: active/hover/disabled/etc). When you set the custom values here, they should work as expected.
Screenshot from Blend for VS2015

Call text from another file into a textblock

Im making a flash card like app in xaml, I created a textblock and was wondering how can I call text in a seperate .txt file so I dont have to write out the whole definition in the same page.
<Textblock Height="150" TextWrapping="Wrap" Text="**how do i link this**">
Thanks
The easiest method would be to do this in the code behind. Either at page_load or triggered some other way.
I think your question is answered here: Windows Phone 8 - reading and writing in an existing txt file in the project
Using this method, I'd store your flash cards in the Assets folder and read them from there.
For your case, you would want to name your Textblock and then set the text from your code behind.
XAML:
<Textblock x:Name="tbFlashCard" Height="150" TextWrapping="Wrap" Text="**how do i link this**">
Modified code from other post:
tbFlashCard.Text = FileHelper.ReadFile(#"Assets\MyTextFile.txt");

Why does not a tooltip work in WPF 2010?

I have a texbox. I would like to show a tooltip when a user brings a mouse on the Textbox.
I write such code, but my program just breaks and VS 2010 gives a window of report.
This is my xaml-code:
<TextBox Height="21" HorizontalAlignment="Left" Margin="231,17,0,0"
Name="Student_textBox" VerticalAlignment="Top" Width="123"
GotFocus="Student_textBox_GotFocus" LostFocus="Student_textBox_LostFocus"
TabIndex="1"
KeyDown="Student_textBox_KeyDown" ToolTip="Hello, Student!"/>
Why does not a tooltip work in WPF 2010?
How to resolve it?
There is nothing wrong with that piece of XAML. Maybe the problem is in one of the event handlers instead (Student_textBox_GotFocus/Student_textBox_LostFocus/Student_textBox_KeyDown)?
What does the error report say? Can you post the error message and possibly a stack trace?

Changing the colour or checkbox in MultiselectList in Windows Phone

In my application i am using MultiselectList for selecting a list of student information. Here my issue is that, I am using a black background image for my page,
Because of this in white theme, the checkbox portion is invisible. I try to edit the template of checkbox item in Blend, but failed, while editing the template its populating a huge chunk of code in XAML.
While editing template instead of style its generating Template (I edited the Multilist Item using Blend).
In the real application i am using itemtemplate and assign the resource to this item template.
So I don't know where to assign this template, and where to edit in that template to change my checkbox colour, this is a blocker issue for me, my friend told me that without theme support the app won’t pass market place submission.
Doing what you want to do, ie. editing the color of the checkbox, depending on the theme and background selected would be too much work. Have you tried using the default styles that come with Silverlight? For example, In this case, PhoneContrastbackgroundColor would be a good choice.
XAML code
<DataTemplate x:Key="whatever">
<TextBlock Text="ItemName"/>
<CheckBox BackgroundColor="{StaticResource PhoneContrastbackgroundColor}"/>
</DataTemplate>