{"id":5924,"date":"2022-01-12T10:45:02","date_gmt":"2022-01-12T09:45:02","guid":{"rendered":"https:\/\/solidt.eu\/site\/?p=5924"},"modified":"2022-07-15T13:59:13","modified_gmt":"2022-07-15T12:59:13","slug":"uniconta-refresh-grid-in-master-page","status":"publish","type":"post","link":"https:\/\/solidt.eu\/site\/uniconta-refresh-grid-in-master-page\/","title":{"rendered":"Uniconta Refresh grid in master page"},"content":{"rendered":"\n<div style=\"height: 250px; position:relative; margin-bottom: 50px;\" class=\"wp-block-simple-code-block-ace\"><pre class=\"wp-block-simple-code-block-ace\" style=\"position:absolute;top:0;right:0;bottom:0;left:0\" data-mode=\"csharp\" data-theme=\"monokai\" data-fontsize=\"14\" data-lines=\"Infinity\" data-showlines=\"true\" data-copy=\"false\">\/\/namespace: Uniconta.ClientTools.Page.BasePage\n\n\/\/ override 'Utility_Refresh' in listview (page)\npublic override void Utility_Refresh(string screenName, object argument = null)\n{\n    if (screenName != nameof(GiftProjectDetailPage)) return;\n    ReloadData(); \/\/ refresh\n}\n\n\/\/ call for refresh in detailview:\nglobalEvents.OnRefresh(NameOfControl, Editrow);\n\n\n\n\/\/ Reference to HomePage\nSystem.Windows.Application.Current.MainWindow as UnicontaClient.HomePage\n\n\/\/ Reference to global session\nUniconta.API.Service.Session.GlobalSession\n\n\n\/\/ Reference to MainPage\nif (Application.Current.MainWindow.Content is UnicontaClient.MainPage mainPage)\n{\n    var dockCtrl = mainPage.dockCtrl;\n    dockCtrl.globalEvents.Refresh += GlobalEvents_Refresh;\n    CloseActions.Add(() => dockCtrl.globalEvents.Refresh -= GlobalEvents_Refresh);\n}\n\nprivate void GlobalEvents_Refresh(string screenName, object argument = null)\n{\n    \/\/ Console.WriteLine($\"screenName: {screenName}: {argument}\");\n    if (StringHelper.Equals(screenName, \"ContactPage2\"))\n    {\n        UpdateContactPersons(Editrow.Debtor);\n    }\n}\n\n\npublic override void PageClosing()\n{\n    if (CloseActions != null)\n    {\n        foreach (var action in CloseActions)\n            action();\n    }\n\n    base.PageClosing();\n}\n\n\n\n\n<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5924","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/5924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/comments?post=5924"}],"version-history":[{"count":2,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/5924\/revisions"}],"predecessor-version":[{"id":6402,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/posts\/5924\/revisions\/6402"}],"wp:attachment":[{"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/media?parent=5924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/categories?post=5924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solidt.eu\/site\/wp-json\/wp\/v2\/tags?post=5924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}