Exemplo n.º 1
0
 private void dgVMList_UnloadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e)
 {
     if (e.Row.DataContext != null)
     {
         (e.Row.DataContext as VMViewModel).Dispose();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Alters the row.
        /// </summary>
        /// <param name="e">The <see cref="Microsoft.Windows.Controls.DataGridRowEventArgs"/> instance containing the event data.</param>
        private void AlterRow(Microsoft.Windows.Controls.DataGridRowEventArgs e)
        {
            var cell = GetCell(DGCallData, e.Row, 1);

            if (cell == null)
            {
                return;
            }

            var item = e.Row.Item as CallData;

            if (item == null)
            {
                return;
            }
            else
            {
                var val = item.Value;
                if (val != null)
                {
                    if ((val.StartsWith("http") || val.StartsWith("www")) &&
                        (_configContainer.AllKeys.Contains("voice.enable.attach-data-popup-url") &&
                         ((string)_configContainer.GetValue("voice.enable.attach-data-popup-url")).ToLower().Equals("true")))
                    {
                        cell.Foreground = Brushes.Blue;
                    }
                }
            }
        }
        /// <summary>
        /// highlight if the setting is changed in backend.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lstSettingDetails_LoadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e)
        {
            if (e.Row.Item != null)
            {
                DataRowView item = e.Row.Item as DataRowView;

                //check if the row exists
                if (item.Row != null)
                {
                    //if any setting is modified,
                    if (Convert.ToBoolean(item.Row["IsModified"]))
                    {
                        e.Row.Background = new SolidColorBrush(Colors.Violet);
                    }
                    else
                    {
                        e.Row.SetResourceReference(Control.BackgroundProperty, "RowBG");
                    }
                }
            }
        }
 private void DataGridLoadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e)
 {
     e.Row.Header = (e.Row.GetIndex() + 1).ToString();
 }
Exemplo n.º 5
0
 private static void DataGrid_LoadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e)
 {
 }
Exemplo n.º 6
0
 /// <summary>
 /// Handles the LoadingRow event of the DGCallData control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="Microsoft.Windows.Controls.DataGridRowEventArgs"/> instance containing the event data.</param>
 private void DGCallData_LoadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e)
 {
     //Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => AlterRow(e)));
     AlterRow(e);
 }