按下"开始"按钮(Windows Phone)时如何进行活动?
更新 如果不可能,那么我怎么能理解用户按下了START按钮?
c# silverlight silverlight-3.0 silverlight-4.0 windows-phone-7
也许这是一个非常简单的问题,但我找不到答案: 如何减少我的代码,几乎相同结构的数量可能非常大:
例如
<Windows:HierarchicalDataTemplate x:Key="**Level2ItemTemplate**"
ItemsSource="{Binding Children}"
ItemTemplate="{StaticResource **Level3ItemTemplate**}">
<Grid Height="100"
Width="100"
Margin="5">
<Border Padding="5"
BorderThickness="1"
BorderBrush="#FFADADAD"
CornerRadius="5">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#FFD47E00"
Offset="0" />
<GradientStop Color="#FF563300"
Offset="1" />
</LinearGradientBrush>
</Border.Background>
<TextBox TextWrapping="Wrap"
Text="{Binding Title, Mode=TwoWay}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontWeight="Bold"
FontSize="13.333"
Style="{StaticResource EditableTitleStyle}" />
</Border>
<Image HorizontalAlignment="Right"
Source="add.png"
Stretch="Fill"
Width="16"
VerticalAlignment="Bottom"
Margin="0,0,2,2"
Height="16">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<Graph:AddSpiderItemAction />
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
<Image HorizontalAlignment="Right"
Height="16"
Source="remove.png"
Stretch="Fill"
VerticalAlignment="Top"
Width="16"
Margin="0,2,2,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown">
<Graph:RemoveSpiderItemAction />
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
</Grid>
</Windows:HierarchicalDataTemplate>
<Windows:HierarchicalDataTemplate …Run Code Online (Sandbox Code Playgroud) 我有一个文字:
Download it directly to the <a href="http://itunes.apple.com/fi/app/goalapp/id502461189?ls=1&mt=8">iTunes Store</a> or <a href="https://market.android.com/details?id=com.strikersoft.meramal.se">Android Market</a>. The application is launched for Swedish app store.
Run Code Online (Sandbox Code Playgroud)
我知道如何在RichTextBox中显示超链接:
http://msdn.microsoft.com/en-us/library/ee681613%28v=vs.95%29.aspx
但是,如何在此代码中为每个人链接创建此链接?
c# silverlight silverlight-3.0 silverlight-4.0 windows-phone-7
在我的Windows Phone应用程序中,我需要使用SHA-1算法获取哈希值.我怎样才能做到这一点?比如我有string text="1234";
在我的Windows Phone application我从xml获取颜色,然后将其绑定到一些元素.
我发现在我的情况下我得到了错误的颜色.
这是我的代码:
var resources = feedsModule.getResources().getColorResource("HeaderColor") ??
FeedHandler.GetInstance().MainApp.getResources().getColorResource("HeaderColor");
if (resources != null)
{
var colourText = Color.FromArgb(255,Convert.ToByte(resources.getValue().Substring(1, 2), 16),
Convert.ToByte(resources.getValue().Substring(3, 2), 16),
Convert.ToByte(resources.getValue().Substring(5, 2), 16));
Run Code Online (Sandbox Code Playgroud)
因此在转换颜色后,我得到了错误的结果.在xml中我有这个:
<Color name="HeaderColor">#FFc50000</Color>
Run Code Online (Sandbox Code Playgroud)
它转化为 #FFFFC500
我正在使用 Log4Net 在我的 Web 应用程序中记录异常。
在这里我找到了一个配置示例:http : //www.csharptocsharp.com/log4net-configuration-for-rockin-loggin
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<log4net>
<!--
This writes the log information to the console window. It only logs events
that are at least at the INFO level (which would mean that DEBUG events are not
captured.
-->
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{ABSOLUTE} [%thread] %level %logger - %message%newlineExtra Info: %property{testProperty}%newline%exception"/>
</layout>
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="INFO"/>
<levelMax value="FATAL"/>
</filter>
</appender>
<!--
This stores information in the log.txt …Run Code Online (Sandbox Code Playgroud) 在我的ASP.Net MVC 3应用程序中,我实现了本地化.我将用户的本地化保存在cookie中.在我的应用程序中,我有autentification.在cookie或会话中保存本地化的最佳方法是什么(会话是2880秒,因为web.config此tyme用户应该再次在应用程序中使用它的语言)
在EXCEL中是一些形式,可以找到一个单元格的值。类似于 INDEX,但不是索引列,而是命名范围。
我想在这个命名范围内找到单元格,我知道行的索引
在我的iPhone应用程序中,我有这样的代码:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Instruction Controller";
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(menuButtonClicked)];
}
#pragma mark private methodes
-(void) menuButtonClicked{
NSLog(@"menuButtonClicked");
}
Run Code Online (Sandbox Code Playgroud)
但是当我点击这个按钮时,它会引发一个例外:"无法识别的选择器被发送到实例".我如何解决这个问题?
UPDATE
2013-05-23 12:21:33.182 CICDP [3091:11603] - [__ NSCFString menuButtonClicked]:无法识别的选择器发送到实例0x8128eb0 2013-05-23 12:21:33.188 CICDP [3091:11603] *由于未被捕获而终止应用程序异常'NSInvalidArgumentException',原因:' - [__ NSCFString menuButtonClicked]:无法识别的选择器发送到实例0x8128eb0'
c# ×8
silverlight ×5
asp.net ×1
asp.net-mvc ×1
excel ×1
ios ×1
iphone ×1
log4net ×1
logging ×1