如何通过此商品索引获取 txt = historico.Items[i].ToString();
文字?我试过这个
"Windows.UI.Xaml.Controls.ListViewItem"
但我得到了这个
{{1}}
答案 0 :(得分:1)
txt = (historico.Items[i] as ListViewItem).Content.ToString();
或
txt = (historico.Items[i] as ListViewItem).Text;
答案 1 :(得分:1)
在MainPage.xaml中:
<p class="flow-text">
{{{questionText}}}
</p>
在MainPage.xaml.cs中,我添加了按钮的click事件:
<Page
x:Class="PushNotification_Sampl.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:PushNotification_Sampl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<ListView Name="list">
<ListViewItem>1</ListViewItem>
<ListViewItem>2</ListViewItem>
<ListViewItem>3</ListViewItem>
<ListViewItem>4</ListViewItem>
<Button x:Name="getBtn" Click="getBtn_Click">Get</Button>
<TextBlock x:Name="text" Width="137" Text="check"></TextBlock>
</ListView>
</Grid>
这在Windows Phone 8.1应用程序中运行良好。成功测试过。希望这会有所帮助。
答案 2 :(得分:0)
String strval = "in=app type=au act='Aut' check='abc|def|status||1234|4567|9080|x.x|ewer|www.yy.com|error'";
String pattern = "(check='\\w+[|]\\w+[|])\\w+";
// ^------ group 1 ------^ ^^-current value of `status`
String result = strval.replaceAll(pattern, "$1"+"success");
// ^^-match from group 1