public sealed override void Dispose()
        {
            if (PivotClient1 != null)
            {
                PivotClient1.Loaded -= PivotClient1_Loaded;
                PivotClient1.Dispose();
            }
            PivotClient1 = null;

            if (olapDataManager != null)
            {
                olapDataManager.OlapDataChanged           -= OlapDataManager_OlapDataChanged;
                olapDataManager.GetCubeSchema             -= OlapDataManager_GetCubeSchema;
                olapDataManager.GetCubeInfoCollection     -= OlapDataManager_GetCubeInfoCollection;
                olapDataManager.GetChildMembers           -= OlapDataManager_GetChildMembers;
                olapDataManager.GetChildrenByMDX          -= OlapDataManager_GetChildrenByMDX;
                olapDataManager.GetOlapDataWithTotalCount -= OlapDataManager_GetOlapDataWithTotalCount;
                olapDataManager.GetLevelMembersUsingMdx   -= OlapDataManager_GetLevelMembersUsingMdx;
                olapDataManager.Dispose();
            }
            olapDataManager = null;

            clientChannel = null;

            base.Dispose();
        }
        public PivotClientCustomization()
        {
            ApplicationLanguages.PrimaryLanguageOverride = "en-US";
            InitializeComponent();

            allowMultiFunctionalSortFilterBinding = new Binding {
                Path = new PropertyPath("IsChecked"), ElementName = "chk_AllowMultiFunctionalSortFilter", Mode = BindingMode.TwoWay
            };
            showValueCellToolTipBinding = new Binding {
                Path = new PropertyPath("IsChecked"), ElementName = "ShowValueCellToolTip", Mode = BindingMode.TwoWay
            };
            showHyperlinkBinding = new Binding {
                Path = new PropertyPath("IsChecked"), ElementName = "ShowHyperlink", Mode = BindingMode.TwoWay
            };
            freezeHeadersBinding = new Binding {
                Path = new PropertyPath("IsChecked"), ElementName = "FreezeHeaders", Mode = BindingMode.TwoWay
            };
            showLegendBinding = new Binding {
                Path = new PropertyPath("IsChecked"), ElementName = "ShowLegend", Mode = BindingMode.TwoWay, Converter = new PivotClientSamples.Converters.BooleanVisibilityConverter()
            };

            PivotClient1.ItemsSource = viewModel.ProductSalesData;
            // Adding rows to SfPivotGrid

            PivotClient1.PivotRows.Add(new Syncfusion.PivotAnalysis.UWP.PivotItem()
            {
                FieldMappingName = "Product", TotalHeader = "Total"
            });
            PivotClient1.PivotRows.Add(new Syncfusion.PivotAnalysis.UWP.PivotItem()
            {
                FieldMappingName = "Date", TotalHeader = "Total"
            });

            // Adding columns to SfPivotGrid
            PivotClient1.PivotColumns.Add(new Syncfusion.PivotAnalysis.UWP.PivotItem()
            {
                FieldMappingName = "Country", TotalHeader = "Total"
            });

            // Adding calculations to SfPivotGrid

            PivotClient1.PivotCalculations.Add(new PivotComputationInfo()
            {
                FieldHeader = "Amount", FieldName = "Amount", Format = "C", SummaryType = Syncfusion.PivotAnalysis.UWP.SummaryType.DoubleTotalSum
            });
            PivotClient1.PivotCalculations.Add(new PivotComputationInfo()
            {
                FieldHeader = "Quantity", FieldName = "Quantity", Format = "#.##", SummaryType = Syncfusion.PivotAnalysis.UWP.SummaryType.Count
            });

            PivotClient1.SetBinding(SfPivotClient.AllowMultiFunctionalSortFilterProperty, allowMultiFunctionalSortFilterBinding);
        }
        public sealed override void Dispose()
        {
            ShowGrandTotal.Click   -= ShowGrandTotal_Click;
            ShowLevelTypeAll.Click -= ShowLevelTypeAll_Click;
            if (rdBtn_Olap != null)
            {
                this.rdBtn_Olap.Click -= OlapDataSource_Click;
            }
            rdBtn_Olap = null;
            if (rdBtn_Relational != null)
            {
                this.rdBtn_Relational.Click -= RelationalDataSource_Click;
            }
            rdBtn_Relational = null;
            allowMultiFunctionalSortFilterBinding = null;
            showValueCellToolTipBinding           = null;
            showHyperlinkBinding = null;
            freezeHeadersBinding = null;
            showLegendBinding    = null;

            if (PivotClient1 != null)
            {
                PivotClient1.Dispose();
            }
            PivotClient1 = null;

            if (pivotClient != null)
            {
                pivotClient.Loaded -= PivotClient_Loaded;
                pivotClient.Dispose();
            }
            pivotClient = null;

            if (viewModel != null)
            {
                viewModel.Dispose();
            }

            base.Dispose();
        }