WinRT C# - create Converter string to string for binding Gridview

后端 未结 2 1295
旧巷少年郎
旧巷少年郎 2021-01-15 05:29

I come to you today for a \"little\" problem. I don\'t know how to create a simple converter because its the first time and I don\'t find a easy example. I would like to cre

2条回答
  •  再見小時候
    2021-01-15 06:29

    Add a class with this code. It will be your converter

    public class ThumbToFullPathConverter : IValueConverter
    {
        public object Convert(object value, Type targettype, object parameter, string Path)
        {
            return ("ms-appdata:///local/" + value).ToString();
        }
        public object ConvertBack(object value, Type targettype, object parameter, string Path)
        {
            throw new NotImplementedException();
        }
    }
    

    Now the below code will explain you how can you use it to bind image in gridview data template.

    Add the page resource in you XAMl page.

    
        
    
    
    
         
    
    

提交回复
热议问题