Windows phone 7 Windows Phone:表情符号网格
如何在windows phone中创建表情符号网格?Windows phone 7 Windows Phone:表情符号网格,windows-phone-7,windows-phone-8,windows-phone,windows-phone-7.1,Windows Phone 7,Windows Phone 8,Windows Phone,Windows Phone 7.1,如何在windows phone中创建表情符号网格? 我是windows phone的新手,我不知道如何实现此功能以及使用哪个控件。。。我在谷歌上搜索过,但没有找到合适的解决方案。我尝试使用网格控件进行创建,但它不起作用。我为此创建了一个自定义控件,如下所示: <Controls:ChildWindow x:Class="ChildWindows.SmileyDialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/pr
我是windows phone的新手,我不知道如何实现此功能以及使用哪个控件。。。我在谷歌上搜索过,但没有找到合适的解决方案。我尝试使用网格控件进行创建,但它不起作用。我为此创建了一个自定义控件,如下所示:
<Controls:ChildWindow x:Class="ChildWindows.SmileyDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=CustomControls"
xmlns:Toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
BorderThickness="2" mc:Ignorable="d"
BorderBrush="{StaticResource PhoneBorderBrush}"
Style="{StaticResource ChildWindowTemplate}" >
<Grid x:Name="LayoutRoot" HorizontalAlignment="Center" VerticalAlignment="Center" Background="{ StaticResource PhoneBackgroundBrush }" >
<ListBox x:Name="itemControl" Margin="4" ItemsSource="{Binding}" Background="White">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<Toolkit:WrapPanel HorizontalAlignment="Center"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Border Margin="10" BorderThickness="1" BorderBrush="Silver">
<Image Margin="5" Width="64" Height="64" Source="{Binding ImagePaths.Large_69x69}" Toolkit:TiltEffect.IsTiltEnabled="True" />
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Controls:ChildWindow>
如果您不评论我的帮助,我希望您能够重用代码。展示您目前的工作,可能有人可以帮助您。我已尝试使用简单的网格控件实现。。但是我不能得到它…@Igor Mesaros:谢谢你的回答,我用不同的方式实现了它。。。我使用了pivot而不是自定义控件,但您的回答在另一方面很有帮助…@esskar ihvnt实现了这一点。。相反,我以其他方式实现了。所以我不能标记为解决方案。。
public partial class SmileyDialog
{
#region Fields
public event CloseEventHandler<EmoticonItem> OnClose;
#endregion Fields
#region Properties
public bool IsOpened { get { return ChildWindowPopup.IsOpen; } }
#endregion Properties
#region Constructor
public SmileyDialog()
{
InitializeComponent();
itemControl.ItemsSource = EmoticonsMap.GetEmoticons();
}
#endregion Constructor
#region overrides
protected override void OnOpened()
{
var page = ((ContentControl)Application.Current.RootVisual).Content as PhoneApplicationPage;
if (page != null) page.BackKeyPress += PageBackKeyPress;
itemControl.SelectedItem = null;
itemControl.SelectionChanged += ItemControlSelectionChanged;
}
protected override void OnClosing(CancelEventArgs e)
{
var page = ((ContentControl)Application.Current.RootVisual).Content as PhoneApplicationPage;
if (page != null) page.BackKeyPress -= PageBackKeyPress;
itemControl.SelectionChanged -= ItemControlSelectionChanged;
if (OnClose != null) OnClose(itemControl.SelectedItem as EmoticonItem);
}
#endregion overrides
#region UI events
private void PageBackKeyPress(object sender, CancelEventArgs e)
{
Close();
}
private void ItemControlSelectionChanged(object sender, SelectionChangedEventArgs e)
{
Close();
}
#endregion UI events
}
private SmileyDialog _smileDialog;
private void RadSmileyImageButton_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
if (_smileDialog != null && _smileDialog.IsOpened) return;
//SetApplicationBarVisibility(false);
if (_smileDialog == null)
{
_smileDialog = new SmileyDialog();
_smileDialog.OnClose += SmileDialogOnClose;
}
_smileDialog.Show();
}