小编rev*_*kpi的帖子

如何在SilverLight中为元素创建自己的属性

有人可以帮我解决这个问题吗?)在我的XAML中我有Listbox元素.我想将我的用户属性添加到它(在我的情况下 - ConnectorStyle)

我的XAML代码:

<ListBox ItemsSource="{Binding Nodes}" ItemsPanel="{StaticResource CanvasItemsPanelTemplate}" 
                 ItemTemplate="{StaticResource NodePictureTemplate}" 
               ItemContainerStyle="{StaticResource CanvasItemStyle}" 
                ConnectorStyle="{StaticResource ConnectorLineStyle}"/>
Run Code Online (Sandbox Code Playgroud)

在我的模型中,我准备了这个属性:

public partial class MainPage : UserControl
    {
        public static readonly DependencyProperty ConnectorStyleProperty = DependencyProperty.Register(
                                           "ConnectorStyle", typeof(Style), typeof(NodePicture), null);
        public MainPage()
        {

            InitializeComponent();

                    }
        public Style ConnectorStyle
        {
            get { return (Style)GetValue(ConnectorStyleProperty); }
            set { SetValue(ConnectorStyleProperty, value); }
        }
    }
Run Code Online (Sandbox Code Playgroud)

但我错了 - 无法解析ConnectorStyle.这样做有简单(或正确的方法)吗?

c# asp.net silverlight silverlight-3.0 silverlight-4.0

1
推荐指数
1
解决办法
175
查看次数

如何从连接字符串中获取值?

我有连接字符串:

<add name="fullDataBase"  
     connectionString="Data Source=.;Initial Catalog=Equipme;Integrated Security=True" 
     providerName="System.Data.SqlClient"/>
Run Code Online (Sandbox Code Playgroud)

当我使用以下字符串时,我可以从中获取目录的名称:

 string connectionString = ConfigurationManager.ConnectionStrings[_connectionString].ConnectionString;
Run Code Online (Sandbox Code Playgroud)

在我的情况下它应该是 Equipme

c#

1
推荐指数
1
解决办法
1501
查看次数

如何在SilverLight中的某个时间(500毫秒)调用某些方法

我有两种方法,例如Method1和Method2.在Method1完成后如何调用Method2 500ms?

 public void Method1()
 {

 }

 public void Method2()
 {

 }
Run Code Online (Sandbox Code Playgroud)

c# silverlight silverlight-3.0 silverlight-4.0

1
推荐指数
1
解决办法
3637
查看次数

如何在WP 7中使用gif动画图像

我看过这篇文章:在Silverlight的WP7应用程序中显示GIF

但就我而言?动画我正在使用弹出窗口.因此,当应用程序启动时,它会显示一个弹出窗口5秒钟.在这个弹出窗口中,我想显示一些.gif图像,但它不起作用.

这是我实现的代码:

    public partial class AnimatedSplashScreen : UserControl
    {
        protected Uri ImageSource
        {
            get;
            set;
        }
        public AnimatedSplashScreen()
        {
            InitializeComponent();
           ImageSource =
                new Uri(
                    "http://upload.wikimedia.org/wikipedia/commons/thumb/3/36/Sunflower_as_GIF.gif/200px-Sunflower_as_GIF.gif",
                    UriKind.Absolute);
            ImageTools.IO.Decoders.AddDecoder<GifDecoder>();

        }
Run Code Online (Sandbox Code Playgroud)

而xaml代码是:

<UserControl.Resources>

        <imagetools:ImageConverter x:Key="ImageConverter" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot"
          Width="480"
          Height="800"
          Background="White">
        <imagetools:AnimatedImage Source="{Binding ImageSource, Converter={StaticResource ImageConverter}}"  />
Run Code Online (Sandbox Code Playgroud)

但结果它不起作用,它显示一个空的背景.

更新:ImageTools.IO.Decoders.AddDecoder(); ImageSource = new Uri(" http://a3.twimg.com/profile_images/1136683647/hisoka_normal.gif ",UriKind.Absolute); 它仍然无法正常工作

c# silverlight silverlight-3.0 silverlight-4.0 windows-phone-7

1
推荐指数
1
解决办法
2698
查看次数

处理完成编辑单元格值的事件(vba)

嗨,在我的EXCEL工作簿中,我正在使用vba.如何处理单元格失去焦点或完成编辑其值的事件.

excel vba excel-2003 excel-vba

1
推荐指数
1
解决办法
1241
查看次数

UITableView行高崩溃

在我的iPhone应用程序中,我有四种类型的单元格.每个细胞都有自己的高度.我想为每个表视图单元格设置行的高度,但它在此方法中崩溃:

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
    NSLog(@"%@", cell);
    if([cell.reuseIdentifier isEqualToString:PastEventWICellIdentifier]){
        return 56;
    }
    if([cell.reuseIdentifier isEqualToString:PastEventWOICellIdentifier]){
        return 56;
    }
    if([cell.reuseIdentifier isEqualToString:EventWICellIdentifier]){
        return 112;
    }
    if([cell.reuseIdentifier isEqualToString:EventWOICellIdentifier]){
        return 112;
    }
    return 56;
}
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

iphone ios

1
推荐指数
1
解决办法
478
查看次数

如何使用正则表达式解析字符串

如何从此文本中获取List():

For the iPhone do the following:<ul><li>Go to AppStore</li><li>Search by him</li><li>Download</li></ul>
Run Code Online (Sandbox Code Playgroud)

应该包括:转到AppStore,按他搜索,下载

c#

0
推荐指数
1
解决办法
161
查看次数

用jquery更改图像src

我有这个代码:

function EnableiPad(event) {
    var id = $(event.currentTarget).attr("data-id");
    var status = $(event.currentTarget).attr("data-status");    
    $.post("/Ipad/ChangeStatus", { id: id, enable: status }, onAjaxSuccess);
};
function onAjaxSuccess(data) {
    var status = $(".button-enable").attr("data-status");

    if (status == 'true') 
    {
        $('#statusImg').attr("src", '/Content/img/disable.png');
    }
    else 
    {
        $('#statusImg').attr("src", '/Content/img/enable.png');
    }
}
Run Code Online (Sandbox Code Playgroud)

但它不会改变图像 - $('#statusImg').attr("src", '/Content/img/disable.png');

更新

这是我的图片:

@if (iPad.Enabled)
{
    <button  class="button-enable" data-original-title="Show timetable"  data-id="@iPad.Id" data-status="false" class="btn btn-mini" style="border: 0; background: transparent; box-shadow: none; padding: 0;">
        <img id="status" width="24" height="24" alt="Delete doctor" src="/Content/img/enable.png" />
    </button>
}
else
{ 
    <button …
Run Code Online (Sandbox Code Playgroud)

javascript c# asp.net-mvc jquery asp.net-mvc-3

-3
推荐指数
1
解决办法
1752
查看次数

检查实体是否在Core Data的上下文中

在我的iPhone应用程序中,我需要检查一个实体是否在Core Data的上下文中?

我该怎么检查这个,有人可以提供一个例子吗?

iphone core-data ios

-3
推荐指数
1
解决办法
1956
查看次数