/// <summary> /// low level method, for create message view /// <see cref="createChannelGrid"/> /// </summary> /// <returns>grid object with needed parameters</returns> private Grid createMessageGrid(string name, string message, string time, Grid obj) { var g1 = GenericsWPF <Grid> .DeepDarkCopy(obj); g1.Visibility = Visibility.Visible; var ch = g1.Children; ((TextBlock)ch[0]).Text = name; ((TextBlock)ch[1]).Text = message; ((TextBlock)ch[2]).Text = time; return(g1); }
/// <summary> /// create channelGrid with selected params; /// other params are getted from pattern; /// </summary> private Grid createChannelGrid(string fullname, int newM, int users, string name) { var g1 = GenericsWPF <Grid> .DeepDarkCopy(w.ChannelSampleGrid); g1.Visibility = Visibility.Visible; var ch = g1.Children; ((TextBlock)ch[0]).Text = fullname; ((TextBlock)ch[1]).Text = "" + newM; ((TextBlock)ch[2]).Text = users + " участников"; ((TextBlock)ch[3]).Text = name; g1.MouseRightButtonDown += w.ChannelSampleGrid_MouseRightButtonDown; return(g1); }