how to save hyperlink button in isolated storage

喜夏-厌秋 提交于 2019-12-02 09:48:59

You can "save" button itself in your code (just leave as it is).

However, you'd want to save hyperlinks themselves. If you need readability (so you can open and read file, which contains hyperlinks, via "Windows Phone Power Tools"), then use json for writing file (sample and screenshots included). Otherwise, use binary stream (sample included).

Well if I am getting your point correctly then. make a wrapper class first

 public class HypProperties
    {
     public string contentText{get;Set;}
    public double Height{get;Set;}
    public double Width{get;Set;}
//othere properties add according to requirements
    }

Now You can use IsolatedStorageSettings.ApplicationSettings to save an object inside. Sample- To save -

HypProperties obj=new HypProperties (){contentText="",Height=height,Width=width};
if(!IsolatedStorageSettings.ApplicationSettings.Contains("KeyName"))
{
IsolatedStorageSettings.ApplicationSettings["KeyName"]=obj;
IsolatedStorageSettings.ApplicationSettings.Save();
}

To retrieve

if(IsolatedStorageSettings.ApplicationSettings.Contains("KeyName"))
        {
        HypProperties obj=IsolatedStorageSettings.ApplicationSettings["KeyName"] as HypProperties;
        }

But I would suggest you to just store the properties of that hyperlink button. Saving a UI Element is not the correct way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!