i want to add some emotions to my twitter client app, such as: ಥ_ಥ (,,Ծ‸Ծ,,)
and some one has special character in his user name,
but the characters don't show up, just displayed as 口口.
here is my code:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Button
Content="(,,Ծ‸Ծ,,)
(,,Ծ‸Ծ,,)
√
ಠ_ಠ
✧ (≖ ‿ ≖)✧"
/>
</Grid>
otherwise, they displayed well on SMS and Internet Explorer,
screenshot is here: http://sdrv.ms/171Qf7t
It looks like you have changed your default font somewhere to one that doesn't have those Unicode characters. Either return to the default font or use something like:
<Button
Content="(,,Ծ‸Ծ,,)
ಠ_ಠ
✧ (≖ ‿ ≖)✧" FontSize="24" FontFamily="Segoe WP Semibold"
/>
which displays correctly when I test it here.
Related
I am attempting to use font 'Segoe MDL2 Assets' glyphs in a c# WinUI desktop program. Microsoft docs specify this:
You can assign a value from the Symbol enumeration, or a Unicode string that references a glyph in the Segoe MDL2 Assets font.
You can use the Character Map application that comes with Windows to browse the font's glyphs and find their Unicode values. Then, use the format "&#x/(UNICODE);" in XAML.
I selected the 'check mark' as a test: U+E001
<Button x:Name="buttonGlyph" ToolTipService.ToolTip="delete" BorderBrush="Transparent" >&#x/U+E001;</Button>
The line won't compile, I get the error 'Invalid character in hexadecimal character entity...'
Have I entered &#x/U+E001; incorrectly?
Thanks!
<Button>
<Button.Content>
<TextBlock FontFamily="Segoe MDL2 Assets"></TextBlock>
</Button.Content>
</Button>
Or a cleaner way:
<Button>
<Button.Content>
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
</Button.Content>
</Button>
I don't have the font to properly specify the name, so I guessed at it. If the font is installed on your system and you type the name correctly in the FontFamily attribute, this should resolve.
I am trying to add a simple map to my app.
I added map reference, added capability in WMAppManifest and this code to page:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<maps:Map x:Name="MyMap" Center="47.6097, -122.3331" ZoomLevel="10" HorizontalAlignment="Left" VerticalAlignment="Top" Loaded="Map_Loaded_1" />
</Grid>
but it show blank map. What I mean blank? a black page!
I can not get it to work. tell me what I missed!?
Try to follow this guide step by step, and see if it helps.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207045(v=vs.105).aspx
Maybe your internet connection is dead (or just not configured properly in emulator)?
Via an XML file, I have to get a title, the link of a video and a date for display on WindowsPhone 8.
I browse the file with the following code:
foreach (var item in xElement.Elements("channel").Elements("item"))
{
var feed = new Feed
{
Link = item.Element("description").Value,
PubDate = DateTime.Now,
Title = item.Element("title").Value
};
Results.Items.Add(feed);
}
This code retrieves the values correctly. I use the binding to link the two :
<ScrollViewer Grid.Row="1" BorderThickness="0">
<ItemsControl Name="Results" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock TextWrapping="Wrap"
Text="{Binding Path=Title}" />
<MediaElement Name="Media"
Source="{Binding Path=Link}"
Stretch="Fill"
AutoPlay="True" />
<TextBlock Text="{Binding Path=PubDate}" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
The problem is that only two videos are displayed (and not always the same). I don't know where the error is it, because all the data is retrieved, including links to my videos.
I would also add controls to the MediaElement such as : Play, Stop,... But I don't know where to place the code.
I'm sorry for my English ! I'm French. Thanks all.
A while ago I remember reading on MSDN that the number of active MediaElement that are fully supported on Windows Phone is one (this was either 7.0 or 7.1 mind you). I can no longer find this reference on MSDN, but if you search the web, you'll find similar assertions (though with no MSDN quotes or whatever).
Try having just the one and see if it works as you expect, and then try to go up to two.
Hi i am trying to learn windows presentation foundation WPF and was trying to develop the simplest application Calculator. But i am having issue in displaying the '-' when i substract a higher value from smaller. For eg. if i do something like this "10 - 20" the output should be "-10" in the screen i.e. textbox. But it is displaying "10-". Somehow the '-' is coming in the end. my xaml code for textbox looks like following:
<TextBox Height="33" HorizontalAlignment="Left" Name="outputbox"
VerticalAlignment="Top" Width="278"
FontFamily="Tahoma" FontSize="18"
FlowDirection="righttoleft" IsReadOnly="True" />
and the code for doing substraction and display looks something like this
if (entry1 > entry2)
{
outputbox.Text = (entry1 - entry2).ToString();
}
else
{
outputbox.Text = "-" + (entry2 - entry1).ToString();
}
while debugging it shows the proper string as "-10" but while displaying in the textbox it is showing the string "10-". Any idea about what is missing???
Just remove the FlowDirection attribute from your TextBox and your result will be fine.
<TextBox Height="33"
HorizontalAlignment="Left"
Name="outputbox" VerticalAlignment="Top"
Width="278"
FontFamily="Tahoma"
FontSize="18" IsReadOnly="True" />
Or you may specify FlowDirection="LeftToRight" which is the default for the TextBox
Thanks All. I removed the "FlowDirection" property and it displayed the proper "-10" but the text was now displayed on the left side of textbox. So i used the "TextAlignment = right" property and it seems to be working fine. Thanks again all of you.
I want to create a small button with three dots on it, like we see everywhere in visual studio, in order to load the FolderBrowserDialog. How best to create this button? Best I did was to get a 23x23 button with margin and padding set to 0, three dots for the text (only two appear) and auto-ellipses on (which makes a third dot appear). The button is still much larger than I'd like and the dots don't stand out very well.
You can copy the ellipsis character (…) from this post, or use Alt-0133 to produce it on demand.
Button.Text = "…";
The button is still much larger than I'd like...
Adjust the font size?
...and the dots don't stand out very well.
Make the font bold? (…)
I suppose if none of this works for you, an image is the next-best thing.
Use some image with dots.
☼☼☼ Use Character Map of Windows to find dots you need and cope/past them into the Text property.
Sample: ···
This is what we use: Button.Text = "...".
If it is too big, you can adjust the font size down.
Set the button's Text to '...' and change its Size property. You can also change the Button's Font, if necessary.
This is what I did to make it look nice in WPF (Using .NET 5)
Code:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="34" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Content="Directory" VerticalAlignment="Center" />
<TextBox Grid.Column="1" Text="{Binding ImagesDirectory}"
VerticalAlignment="Center" VerticalContentAlignment="Center"
Height="24" />
<Button Grid.Column="2" Content="⚫⚫⚫"
FontSize="4" Margin="-1,5,5,5" Height="24" />
<Grid>
Preview: