小编Den*_*der的帖子

如何在Blend中的设计时滚动ScrollViewer

我还没有找到Blend/WPF的这个问题的信息.仅适用于Eclipse,这无济于事.

我目前正在设计一个WPF 4应用程序对话框.它应该是一个ScrollViewer具有不同元素的StackPanel:

<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Height="470" VerticalAlignment="Top">
  <StackPanel Height="1893" Width="899">
    <!-- Elements here ... -->
  </StackPanel>
<ScrollViewer>
Run Code Online (Sandbox Code Playgroud)

到目前为止一切都按预期工作.滚动条可见.我的问题是我无法在Blend或Visual Studio 2012中向下滚动设计时间.运行项目工作正常,用户可以向下滚动到其他对象.

但在设计时,似乎没有机会向下滚动以准确定位(现在隐藏)控件.

一个解决方案是扩展控件以显示完整的内容.但这不是最好的解决方案.有没有人有设计时适当滚动的线索?

非常感谢你.

wpf xaml blend scrollviewer

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

C#中的dynamic和T之间的实际区别是什么

我阅读了有关dynamicC#2010中的Type的信息。(对应的msdn条目)

我感到困惑的实际差别T,并dynamic同时开发的通用功能。我目前的测试并未显示使用dynamic的新方法,而使用则无法实现T。另外看来,动态技术在运行时需要更多的时间来完成相同的任务。

一些示例代码让我明白了:

// Sample Object
public class SampleObj
{
    public string Test { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

我的测试方法(也测量速度):

static void Main(string[] args)
{
    var sampleObj1 = new SampleObj { Test = "Test1" };
    var sampleObj2 = new SampleObj { Test = "Test2" };

    Stopwatch c1 = Stopwatch.StartNew();
    bool res1 = CompareObjectsT<SampleObj>(sampleObj1, sampleObj2);
    c1.Stop();
    Console.WriteLine("Comparison T: {0} time: {1} ms", res1, c1.ElapsedMilliseconds);


    Stopwatch c2 = Stopwatch.StartNew(); …
Run Code Online (Sandbox Code Playgroud)

generics dynamic c#-4.0

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

如何在MVC 4中使用jQuery更新List <Model>

我目前正在尝试使用修改后的索引视图创建设置页面.目标是用户显示所有设置,并可以在一个视图中更改所有设置,使用一个按钮保存所有设置.应使用Ajax更新设置.

我目前的做法:

视图:

<script language="javascript">
    $(function() {
        $('#editSettings').submit(function () {
            if ($(this).valid()) {
                $.ajax({
                    url: this.action,
                    type: this.method,
                    data: $(this).serialize(),
                    success: function (result)
                    {
                        alert(result);                       
                    }
                });
            }
            return false;
        });
    });
</script>

[ ... ]

@using (Ajax.BeginForm("Edit", "Settings", new AjaxOptions {UpdateTargetId = "result"}, new { @class = "form-horizontal", @id = "editSettings" } ))
{
    foreach (Setting item in ViewBag.Settings) 
    {
        @Html.Partial("_SingleSetting", item)
    }
    <input type="submit" value="modify" />
}
Run Code Online (Sandbox Code Playgroud)

部分视图加载设置: …

collections jquery asp.net-mvc-4

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