Esempio n. 1
0
        private void button1_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            MyDomainContext MyContext = new MyDomainContext();
            object          myState   = new object();

            MyContext.GetLocalTemperature("KBH", GetLocalTemperature_Completed, myState);
        }
    public OptionsViewModel()
    {
        var context = new MyDomainContext();

        _Tags = context.Tags;
        context.Load(
            context.GetTagsQuery(),
            (op) =>
        {
            if (op.HasError && !op.IsErrorHandled)
            {
                op.MarkErrorAsHandlere();
            }
            IsBusy = false;
        },
            null);
    }
    public OptionsViewModel()
    {
        IsBusy = True;
        var context = new MyDomainContext();

        _Tags = context.Tags;
        //if called elsewhere but from ctor, make sure context.IsLoading is false;
        //The Load method is throwing an exception if re-loading when a load is on.
        //Debug.Assert(!context.IsLoading);
        context.Load(
            context.GetTagsQuery(),
            (op) =>
        {
            if (op.HasError && !op.IsErrorHandled)
            {
                op.MarkErrorAsHandlere();
            }
            IsBusy = false;
        },
            null);
    }