有没有办法ScrollViewer在Windows Phone 8.1 Runtime中平滑地设置垂直偏移量?
我尝试过使用该ScrollViewer.ChangeView()方法,无论是否将disableAnimation参数设置为true或false,都不会对垂直偏移的更改进行动画处理.
例如:myScrollViewer.ChangeView(null, myScrollViewer.VerticalOffset + p, null, false);
偏移在没有动画的情况下更改.
我也试过使用垂直偏移中介:
/// <summary>
/// Mediator that forwards Offset property changes on to a ScrollViewer
/// instance to enable the animation of Horizontal/VerticalOffset.
/// </summary>
public sealed class ScrollViewerOffsetMediator : FrameworkElement
{
/// <summary>
/// ScrollViewer instance to forward Offset changes on to.
/// </summary>
public ScrollViewer ScrollViewer
{
get { return (ScrollViewer)GetValue(ScrollViewerProperty); }
set { SetValue(ScrollViewerProperty, value); }
}
public static …Run Code Online (Sandbox Code Playgroud) 我正在尝试为Windows Universal Application创建事件日志.早些时候我们不得不System.Diagnostics EventLog记录事件,但我在Windows 10 Universal Apps平台上找不到类似的东西.是否可以为Windows 10创建日志,是否可以将这些日志写入文件以便以后访问?
我搜索了很多,但找不到任何东西.
我ListBoxItem在Windows Phone 8应用程序上遇到问题,同时试图让它们伸展到所有宽度ListBox.
我的ListBox:
<ListBox
ItemsSource="{Binding Events}"
behaviors:ItemClickCommandBehavior.Command="{Binding EventSelectedCommand}"
ItemTemplate="{StaticResource EventListTemplateSelector}"/>
Run Code Online (Sandbox Code Playgroud)
它的DataTemplates在一个单独的xaml资源文件中:
<DataTemplate x:Key="EventListHeaderTemplate">
<Border HorizontalAlignment="Stretch">
<Grid Height="50">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding ImageUri}" VerticalAlignment="Center" HorizontalAlignment="Center" Height="30"/>
<TextBlock Grid.Column="1" Text="{Binding SomeText}" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="Black"/>
</Grid>
</Border>
</DataTemplate>
Run Code Online (Sandbox Code Playgroud)
我不能让这些物品真正拉伸,我不知道问题出在哪里.我试图设置ItemContainerStyleHorizontalCOntentAlignment ="Stretch",但它不起作用.我已经尝试了许多其他组合,似乎只将Border或Grid宽度设置为常量工作,另一个有效的解决方案是将Border宽度设置为绑定到包含ListBox的ActualWidth,但我想使用Stretch变种如果可以使它工作.
我有这个
String str = "a,pnp,a|pnp,lab2|pnp,a|pnp,lab2,utr,utr";
String[] strings = str.split("|");
Run Code Online (Sandbox Code Playgroud)
这段代码不会围绕'|'拆分 相反,它会分割每个字符
strings[0] == "a";
strings[1] == ",";
Run Code Online (Sandbox Code Playgroud)
等等.
如何让这个工作得到
strings[0] == "a,pnp,a"
strings[1] == "pnp,lab2"
...
Run Code Online (Sandbox Code Playgroud) 我有一个方法,getValue像这样的
public Object getValue() {
return Integer.valueOf(0);
Run Code Online (Sandbox Code Playgroud)
}
和主方法中的调用:
getValue() + 5;
Run Code Online (Sandbox Code Playgroud)
这是简化的.
如何在不使用main方法进行转换的情况下使其工作,而是如果可能的话如何转换返回类型?
c# ×2
java ×2
winrt-xaml ×2
alignment ×1
listbox ×1
listboxitem ×1
methods ×1
object ×1
return ×1
split ×1
string ×1
windows-10 ×1
xaml ×1