English 中文(简体)
与清单问题相关的数据
原标题:Data binding with ListPicker issue

I am trying to bind the data from linq xml in isolated storage. The data templates (ItemTemplate and FullModeItemTemplate) work fine and only show the value saved in the element or attribute in the xml document.

            <toolkit:ListPicker.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding BindName}" Margin="0"/>
                </DataTemplate>
            </toolkit:ListPicker.ItemTemplate>
            <toolkit:ListPicker.FullModeItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="16,21,0,20">
                        <TextBlock Text="{Binding BindName}" Margin="16,0,0,0" FontSize="43" FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                    </StackPanel>
                </DataTemplate>
            </toolkit:ListPicker.FullModeItemTemplate>

然而,尽管在名单上的皮尔斯,在选择时似乎使用这一名称,但名单采集者持有的实际价值是:

appname.pagename + namestringusedwhensetting

座右铭的名字来自我所说的话。 我使用这种方法:

    public class BindingSetter
    {
        string sValue;

        public string SValueN
        {
            get { return sValue; }
            set { sValue = value; }
        }
    }

因此,它正在返回:

appname.pagename + sValue

我在整个申请中都使用了约束性,在这样做之前,我没有这个问题。

提前感谢。

最佳回答

我已设法完成这项工作。 2. 利用选定项目一的价值:

((appname.PageName.ClassUsedToBindData)(ListPickerName.SelectedItem)).String

例如。

((calculator.MainPage.CalculateBinding)(FunctionSelector.SelectedItem)).Function

希望能帮助那些像我这样挣扎的人!

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签