我有一个背景图片,其中包含我的应用程序的标题.我不想在磁贴上显示Windows Phone标题 - 因为在那里显示它会掩盖我想要显示的内容.
多个Windows Phone应用程序(如Office)在其实时磁贴上根本不显示任何标题.但是,如果您尝试为实时磁贴输入空白名称,Visual Studio会向您抱怨....
是不是显示了一个单独的标题层,只有微软可以使用的东西?
我正在开发Windows Phone应用程序,但我相信这也适用Silverlight.我想创建一个Storyboard(现在我创造它在我的测试代码隐藏页的全局变量),其改变Rectangle的Fill由透明属性设置为红色,然后回透明.我将Storyboard在多个矩形中重新使用它,所以我希望能够Begin()从代码隐藏中访问它.我找不到这样的例子,所以我用我认为可行的方法给了它一个镜头.
初始设置:
sb = new Storyboard();
turnOn= new ColorAnimation();
turnOn.From = Colors.Transparent;
turnOn.To = Colors.Red;
turnOn.Duration = new TimeSpan(0, 0, 0, 0, 500); //half second
turnOff= new ColorAnimation();
turnOff.From = Colors.Red;
turnOff.To = Colors.Transparent;
turnOff.Duration = new TimeSpan(0, 0, 0, 0, 500); //half second
Storyboard.SetTargetProperty(turnOn, new PropertyPath("(Rectangle.Fill)"));
Storyboard.SetTargetProperty(turnOff, new PropertyPath("(Rectangle.Fill)"));
sb.Children.Add(turnOn);
sb.Children.Add(turnOff);
canvas.Resources.Add("sb", sb); // this is the canvas where the rectangles will be
Run Code Online (Sandbox Code Playgroud)
然后,在任何时候,如果我有一个Rectangle实例,它将在 …
我有一个我正在开发的Windows Phone应用程序,我的共享按钮打开一个带有几个选项的小弹出窗口,使用以下代码:
private void share_Click(object sender, System.EventArgs e)
{
Popup share= new Popup();
share.Child = new sharePopup();
share.IsOpen = true;
share.VerticalOffset = 30;
share.HorizontalOffset = 0;
}
Run Code Online (Sandbox Code Playgroud)
现在,这个弹出窗口有一个"关闭"按钮,但是如果我不点击它,而是点击前一个仍然可见的页面上的另一个按钮,即使在移动到新页面之后,弹出窗口也会保持原位.我必须点击"关闭"弹出窗口才能消失.
如果我点击弹出窗口之外的任何地方,我正在寻找的方法是关闭弹出窗口.是否有预定义的方法来执行此操作?如果没有,我可以采取哪些方式?
提前致谢
编辑:这是弹出窗口的c#代码
public partial class sharePopup : UserControl
{
public sharePopup()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Popup mensaje = this.Parent as Popup;
mensaje.IsOpen = false;
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
this.Focus();
}
private void UserControl_LostFocus(object sender, RoutedEventArgs e)
{
Popup mensaje = this.Parent …Run Code Online (Sandbox Code Playgroud) 我使用下面的代码实现了计时器(或秒表).我想知道是否有一种有效且标准的方法可以在Windows Phone中使用c#实现这一点.
任何建议,将不胜感激.
private void start_click()
{
lhours = 0; lmins = 0; lsecs = 0; lmsecs = 0;
myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1000); // 1000 Milliseconds
myDispatcherTimer.Tick += new EventHandler(Each_Tick);
myDispatcherTimer.Start();
}
public void Each_Tick(object o, EventArgs sender)
{
lsecs = lsecs + 1;
if (lsecs > 59)
{
lsecs = 0;
lmins = lmins + 1;
if (lmins > 59)
{
lmins = 0;
lhours = lhours + 1;
if (lhours > 23)
{
lhours …Run Code Online (Sandbox Code Playgroud) 当我尝试通过模板在Windows Phone 8中将我的地图添加用户位置标记时,所有点都会出现在地图的左上角.我确信我有不同的位置这是我的代码:
<maps:Map x:Name="myMap" Center="{Binding CenterPoint}" ZoomLevel="5">
<toolkit:MapExtensions.Children>
<ItemsControl ItemsSource="{Binding AllLocations}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Grid/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<toolkit:MapChildControl>
<toolkit:UserLocationMarker Background="Blue" Foreground="Green" GeoCoordinate="{Binding coordinate,Converter={StaticResource GeoCoordinateConverter}}"/>
</toolkit:MapChildControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</toolkit:MapExtensions.Children>
</maps:Map>
Run Code Online (Sandbox Code Playgroud) 我正在努力Windows Phone 8,我有很长的列表选择器,其中包含很少的项目.当我点击我需要添加一些动画的项目时,移动文本并返回.如何实现这一目标?我也试图将相同的内容应用于列表框.
我试过这个:
<Style x:Key="LongListSelectorStyle1" TargetType="phone:LongListSelector">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<UserControl>
<Border x:Name="MyBorder" Background="Transparent">
<VisualStateManager.VisualStateGroups >
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Selected">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background)" Storyboard.TargetName="MyBorder">
<DiscreteObjectKeyFrame KeyTime="0" Value="#000000"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Border>
</UserControl>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
以下是示例截图

我怎样才能实现这一目标?
我为Windows Phone 8.1开发了音乐应用程序.我使用BackgroundTask并访问手机音乐库.应用程序在具有虚拟SD卡的模拟器上工作正常,但在设备上不起作用.在设备上尝试播放时,会发生错误:
Failed with error code System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Run Code Online (Sandbox Code Playgroud)
此问题代码,发生错误.为简单城市放置在前台应用程序中的代码:
BackgroundMediaPlayer.Current.SetUriSource(new Uri("C:\\Data\\Users\\Public\\Music\\Ballroom\\Juan Camus - Now That The Love's Gone.mp3"));
BackgroundMediaPlayer.Current.Play();
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?
background-music media-player audio-player windows-phone windows-phone-8.1
我在WP 8.1 XAML应用程序的某些页面中将NavigationCacheMode设置为Required.如何从中删除特定页面?这不是导航堆栈.
我有一个具有@base属性的类.@是必需的,因为"base"是C#语言的保留字.
我如何从XAML绑定到此属性?
我试图AudioVideoCaptureDevice在我的应用程序中使用命名空间,但我似乎无法找到命名空间.我的猜测是我错过了汇编参考,但我不确定是否需要这样做.我正在使用Visual Studio 2015并针对Windows Phone 8.1 SDK进行构建.




windows-phone ×10
c# ×7
silverlight ×2
windows ×2
wpf ×2
audio-player ×1
here-api ×1
maps ×1
media-player ×1
popup ×1
storyboard ×1
timer ×1
winrt-xaml ×1
xaml ×1