Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Phone 7.1 app keeps crashing #52

Closed
shism2 opened this issue Mar 19, 2012 · 2 comments
Closed

Windows Phone 7.1 app keeps crashing #52

shism2 opened this issue Mar 19, 2012 · 2 comments
Labels

Comments

@shism2
Copy link

shism2 commented Mar 19, 2012

Every time I try to use ReactiveObject in a viewmodel the application will just start crashing. If I use the INotifyPropertyChanged then the application stops crashing.

Here is the code:

using ReactiveUI;
using System.Collections.ObjectModel;
using MyForum.Models;
using System;
namespace MyForum
{
public class MainViewModel : ReactiveObject
{

    public ObservableCollection<PivotInfoItem> _PivotItems { get; set; }
    public MainViewModel()
    {
       this._PivotItems = new ObservableCollection<PivotInfoItem>();
        LoadData();
    }


    public ObservableCollection<PivotInfoItem> PageCollection
    {
        get { return _PivotItems; }
        set
        {
            this.RaiseAndSetIfChanged(x => x.PageCollection,value);
        }
    }



    public bool _loadvis;
    public Boolean OverlayVis
    {
        get
        {
        return _loadvis;
        }

       set
        {

            this.RaiseAndSetIfChanged(x => OverlayVis, value);
        }
    }


    public bool IsDataLoaded
    {
        get;
        private set;
    }

    /// <summary>
    /// Creates and adds a few ItemViewModel objects into the Items collection.
    /// </summary>
    public void LoadData()
    {
        // Sample data; replace with real data
     //   this._PivotItems.Add(new PivotInfoItem() { Title = "Discover" });
     //   this._PivotItems.Add(new PivotInfoItem() {Title="Search" });
        this.IsDataLoaded = true;
    }


}

}

@shism2
Copy link
Author

shism2 commented Mar 19, 2012

using System;
namespace MyForum.Models
{
public class PivotInfoItem//:INotifyPropertyChanged
{
private String _title;
public string Title
{
get
{
return _title;
}
set
{
//if (_title != value)
//{
_title = value;
// OnPropertyChanged("Title");
//}
}
}

}

}

@shism2
Copy link
Author

shism2 commented Mar 20, 2012

I got it thanks... I was missing some references.

@shism2 shism2 closed this as completed Mar 20, 2012
@lock lock bot added the outdated label Jun 26, 2019
@lock lock bot locked and limited conversation to collaborators Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant