private void setPanelShow(FormNewsList result) { for (int i = 2; i <= 12; i++) { ((TextBlock)(result.FindName("time" + i))).Dispatcher.Invoke(new setTextBlockVisibilityDelegate(setTextBlockVisibility), ((TextBlock)(this.FindName("time" + i))), false); ((TextBlock)(result.FindName("address" + i))).Dispatcher.Invoke(new setTextBlockVisibilityDelegate(setTextBlockVisibility), ((TextBlock)(this.FindName("address" + i))), false); ((TextBlock)(result.FindName("time" + i))).Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), ((TextBlock)(this.FindName("time" + i))), ""); ((TextBlock)(result.FindName("address" + i))).Dispatcher.Invoke(new setTextBlockTextDelegate(setTextBlockText), ((TextBlock)(this.FindName("address" + i))), ""); } }
private void getTextBlock(FormNewsList obj, string name) { object o = obj.FindName(name); if (name.Contains("time")) { timeTextBlock = (TextBlock)(o); } if (name.Contains("address")) { addressTextBlock = (TextBlock)(o); } }